beacon_api.conf.configΒΆ
DB Configuration.
Specify the necessary parameters for connecting to PostgreSQL server by making use of the environmental variables. We use:
DATABASE_URL
- PostgreSQL server addressDATABASE_PORT
- PostgreSQL server portDATABASE_USER
- PostgreSQL user forbeacon-python
DATABASE_PASSWORD
- PostgreSQL user associated passwordDATABASE_NAME
- PostgreSQL database name/view utilised by thebeacon-python
DATABASE_SCHEMA
- in case a schema is used
The variable is then used to configure the application to connect to that database using asyncpg. At this point we also initialize a connection pool that the API is going to use on all its endpoints.
Functions
init_db_pool () |
Create a connection pool. |