minos.aggregate.transactions.repositories.abc

Classes

TransactionRepository

class TransactionRepository[source]

Bases: TransactionRepository, InjectableMixin

__init__(lock_pool=None, pool_factory=None, *args, **kwargs)[source]
Parameters
async submit(transaction)[source]

Submit a new or updated transaction to store it on the repository.

Parameters

transaction (TransactionEntry) – The transaction to be stored.

Returns

This method does not return anything.

Return type

TransactionEntry

async get(uuid, **kwargs)[source]

Get a TransactionEntry from its identifier.

Parameters
  • uuid (UUID) – Identifier of the RootEntity.

  • kwargs – Additional named arguments.

Returns

The TransactionEntry instance.

Return type

TransactionEntry

async select(uuid=None, uuid_ne=None, uuid_in=None, destination_uuid=None, status=None, status_in=None, event_offset=None, event_offset_lt=None, event_offset_gt=None, event_offset_le=None, event_offset_ge=None, updated_at=None, updated_at_lt=None, updated_at_gt=None, updated_at_le=None, updated_at_ge=None, **kwargs)[source]

Get a transaction from the repository.

Parameters
  • uuid (Optional[UUID]) – Transaction identifier equal to the given value.

  • uuid_ne (Optional[UUID]) – Transaction identifier not equal to the given value

  • uuid_in (Optional[tuple[uuid.UUID, ...]]) – Transaction identifier within the given values.

  • destination_uuid (Optional[UUID]) – Destination Transaction identifier equal to the given value.

  • status (Optional[TransactionStatus]) – Transaction status equal to the given value.

  • status_in (Optional[tuple[str, ...]]) – Transaction status within the given values

  • event_offset (Optional[int]) – Event offset equal to the given value.

  • event_offset_lt (Optional[int]) – Event Offset lower than the given value

  • event_offset_gt (Optional[int]) – Event Offset greater than the given value

  • event_offset_le (Optional[int]) – Event Offset lower or equal to the given value

  • event_offset_ge (Optional[int]) – Event Offset greater or equal to the given value

  • updated_at (Optional[datetime]) – Updated at equal to the given value.

  • updated_at_lt (Optional[datetime]) – Updated at lower than the given value.

  • updated_at_gt (Optional[datetime]) – Updated at greater than the given value.

  • updated_at_le (Optional[datetime]) – Updated at lower or equal to the given value.

  • updated_at_ge (Optional[datetime]) – Updated at greater or equal to the given value.

  • kwargs – Additional named arguments.

Returns

An asynchronous iterator.

Return type

AsyncIterator[TransactionEntry]

write_lock()[source]

Get write lock.

Returns

An asynchronous context manager.

Return type

Lock

property already_destroyed: bool

Already Destroy getter.

Returns

A boolean value.

property already_setup: bool

Already Setup getter.

Returns

A boolean value.

async destroy()

Destroy miscellaneous repository things.

Returns

This method does not return anything.

Return type

None

classmethod from_config(config=None, **kwargs)

Build a new instance from config.

Parameters
  • config (Optional[Union[Config, Path]]) – Config instance. If None is provided, default config is chosen.

  • kwargs – Additional named arguments.

Returns

A instance of the called class.

Return type

S

classmethod get_injectable_name()

Get the injectable name.

Returns

A str value.

Return type

str

async setup()

Setup miscellaneous repository things.

Returns

This method does not return anything.

Return type

None