Repository and UnitOfWork
The ODA provides a UnitOfWork and Repository abstraction which should be the main interface to the ODA from within the OSO Python applications. The diagram below shows the expected architecture of OSO, and which applications will use the Repository interface.
The Repository and UnitOfWork are abstract classes that are implemented for each entity. They use a abstract bridge interface for the persistence, which has a single Postgres implementation.
The following environment variables are used to configure the Repository and UnitOfWork. For more details on setting these values inside the via the Helm chart
for the ska-db-oda server, see Deployment to Kubernetes. A similar process should be in place for any application which imports the classes, e.g. ska-oso-services.
Environment variable |
Relevant implementation |
Description |
Required/optional |
|---|---|---|---|
PGHOST |
|
The address of the PostgreSQL instance to connect to, e.g. |
Required |
PGPORT |
|
The port of the PostgreSQL instance to connect to, e.g. |
Optional - default: |
PGDATABASE |
|
The name of the database in the PostgreSQL instance, e.g. |
Optional - default: |
PGUSER |
|
The admin user in the PostgreSQL instance, e.g. |
Optional - default: |
PGPASSWORD |
|
The password for the admin user in the PostgreSQL instance. |
Required |
Note
This is a work in progress as is expected to be completed as part of BTN-2414