minos.plugins.aiopg.factories.aggregate.snapshots.queries

Classes

AiopgSnapshotQueryDatabaseOperationBuilder

Aiopg Snapshot Query Database Operation Builder class.

class AiopgSnapshotQueryDatabaseOperationBuilder[source]

Bases: object

Aiopg Snapshot Query Database Operation Builder class.

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

__init__(name, condition, ordering=None, limit=None, transaction_uuids=(NULL_UUID,), exclude_deleted=False, table_name=None)[source]
Parameters
  • name (str) –

  • condition (_Condition) –

  • ordering (Optional[_Ordering]) –

  • limit (Optional[int]) –

  • transaction_uuids (Iterable[UUID, ...]) –

  • exclude_deleted (bool) –

  • table_name (Optional[str]) –

build()[source]

Build a query.

Returns

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

Return type

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

static generate_random_str()[source]

Generate a random string

Returns

A random string value.

Return type

str