Skip to content

Postgres repository

filter_events(filters)

Filters events based on provided filter criteria.

PARAMETER DESCRIPTION
filters

filters to apply.

TYPE: Filters

RETURNS DESCRIPTION
List[Event]

List[types.Event]: list of events.

get_event(event_id)

Retrieves a single event from the repository.

PARAMETER DESCRIPTION
event_id

event ID.

TYPE: str

RETURNS DESCRIPTION
Event | None

types.Event | None: event object or None if not found.

remove_all_events()

Removes all events from the repository.

RETURNS DESCRIPTION
Result

types.Result: result of the operation.

remove_event(event_id, session=None, defer_commit=False)

Removes a single event from the repository.

PARAMETER DESCRIPTION
event_id

event ID.

TYPE: str

session

session to use.

TYPE: Session | None DEFAULT: None

defer_commit

whether to defer the commit.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Result

types.Result: result of the operation.

remove_events(filters)

Removes a filtered set of events from the repository.

PARAMETER DESCRIPTION
filters

filters to apply.

TYPE: Filters

RETURNS DESCRIPTION
Result

types.Result: result of the operation.

test_connection()

Tests the connection to the repository.

RETURNS DESCRIPTION
bool

whether the connection was successful.

TYPE: bool

write_event(event, session=None, defer_commit=False)

Writes a single event to the repository.

PARAMETER DESCRIPTION
event

event to write.

TYPE: Event

session

session to use.

TYPE: Session | None DEFAULT: None

defer_commit

whether to defer the commit.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Result

types.Result: result of the operation.

write_events(events)

Write multiple events to the repository.

PARAMETER DESCRIPTION
events

events to write.

TYPE: Iterable[Event]

RETURNS DESCRIPTION
Result

types.Result: result of the operation.