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 address
  • DATABASE_PORT - PostgreSQL server port
  • DATABASE_USER - PostgreSQL user for beacon-python
  • DATABASE_PASSWORD - PostgreSQL user associated password
  • DATABASE_NAME - PostgreSQL database name/view utilised by the beacon-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.