minos.aggregate.snapshots.pg.queries module

class minos.aggregate.snapshots.pg.queries.PostgreSqlSnapshotQueryBuilder(aggregate_name, condition, ordering=None, limit=None, transaction_uuids=(UUID('00000000-0000-0000-0000-000000000000'),), exclude_deleted=False)[source]

Bases: object

PostgreSQL Snapshot Query Builder class.

This class build postgres-compatible database queries over fields based on a condition, ordering, etc.

__init__(aggregate_name, condition, ordering=None, limit=None, transaction_uuids=(UUID('00000000-0000-0000-0000-000000000000'),), exclude_deleted=False)[source]
build()[source]

Build a query.

Return type

tuple[psycopg2.sql.Composable, dict[str, typing.Any]]

Returns

A tuple in which the first value is the sql sentence and the second one is a dictionary containing the query parameters.

static generate_random_str()[source]

Generate a random string

Return type

str

Returns

A random string value.