PostgresSnapshotQueryStorage

class PostgresSnapshotQueryStorage @JvmOverloads constructor(dataSource: DataSource, val context: String, val options: PostgresQueryOptions = PostgresQueryOptions(), dispatcher: CoroutineDispatcher = VirtualThreads.dispatcher, ddlDataSource: DataSource = dataSource) : CachedQueryBindings<AggregateType>

The snapshot query storage of one bounded context on PostgreSQL: the PostgresQueryBackend of each of its aggregate types, over that aggregate's own snapshot table, which PostgresSnapshotStore writes, with the facts PostgresQuerySchemaAdapter reads from the table; and the management of the expression indexes its aggregates declare (manageIndexes). The queries and the facts read dataSource; the indexes are created through ddlDataSource, the store's own, so a dataSource of a read replica (query-data-source) never takes DDL.

Constructors

Link copied to clipboard
constructor(dataSource: DataSource, context: String, options: PostgresQueryOptions = PostgresQueryOptions(), dispatcher: CoroutineDispatcher = VirtualThreads.dispatcher, ddlDataSource: DataSource = dataSource)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Manages indexes (planned by PostgresQueryIndexes.plan for aggregates of this context) as PostgresQueryOptions.indexDdl says. Blocking: a host calls it once at startup, after the tables exist.

Link copied to clipboard
fun table(aggregateName: String): String

The snapshot table of aggregateName, quoted.