PostgresRepository module (ska_db_oda.infrastructure.postgres.repository)
This module contains implementations of the AbstractRepository class, using Postgres as the data store.
- class ska_db_oda.infrastructure.postgres.repository.PostgresBridge(postgres_mapping: PostgresMapping, connection: psycopg.Connection)[source]
Implementation of the Repository bridge which persists entities in a PostgreSQL instance.
- create(entity: T) T [source]
Implementation of the RepositoryBridge method.
See
create()
docstring for details
- query(qry_params: QueryParams) List[U] [source]
Queries the latest version of the entity based on QueryParams class from the ODA and returns the corresponding entity ID
Returns an empty list if no entities in the repository match the parameters.
- Raises:
ValueError – if the qry_params are not supported
OSError – if an error occurs while querying the entity