Aller au contenu
Français

PostgresSnapshotStore

Ce contenu n’est pas encore disponible dans votre langue.

Defined in: src/persistence/snapshot-stores/PostgresSnapshotStore.ts:11

SnapshotStore backed by PostgreSQL (pg). Behaviour lives in RelationalSnapshotStore; this class supplies the Postgres dialect (ON CONFLICT … DO UPDATE upsert, LIMIT-in-subquery prune) and the pool.

  • RelationalSnapshotStore

new PostgresSnapshotStore(options?): PostgresSnapshotStore

Defined in: src/persistence/snapshot-stores/PostgresSnapshotStore.ts:12

PostgresSnapshotStoreOptions = {}

PostgresSnapshotStore

RelationalSnapshotStore.constructor

close(): Promise<void>

Defined in: src/persistence/LazyStore.ts:66

Promise<void>

RelationalSnapshotStore.close


delete(persistenceId, toSeq): Promise<void>

Defined in: src/persistence/relational/RelationalSnapshotStore.ts:101

Delete snapshots up to and including toSeq. Useful for pruning.

string

number

Promise<void>

RelationalSnapshotStore.delete


loadBefore<S>(persistenceId, seq, _options?): Promise<Option<Snapshot<S>>>

Defined in: src/persistence/relational/RelationalSnapshotStore.ts:94

Load the newest snapshot with sequenceNr < seq, or None.

S

string

number

PersistenceOptions

Promise<Option<Snapshot<S>>>

RelationalSnapshotStore.loadBefore


loadLatest<S>(persistenceId, _options?): Promise<Option<Snapshot<S>>>

Defined in: src/persistence/relational/RelationalSnapshotStore.ts:87

Load the newest snapshot for persistenceId, or None if none exist. options.encryption is required when client-side encryption was used at write time — the store has no other way to obtain the master key. Stores that don’t encrypt ignore the field.

S

string

PersistenceOptions

Promise<Option<Snapshot<S>>>

RelationalSnapshotStore.loadLatest


save<S>(persistenceId, seq, state, _options?): Promise<Snapshot<S>>

Defined in: src/persistence/relational/RelationalSnapshotStore.ts:72

Persist a snapshot at seq — typically the seq of the latest event applied. Optional options carry per-call preferences from the caller (e.g. compression/encryption set on the actor). Stores that cannot honour them silently ignore the field.

S

string

number

S

PersistenceOptions

Promise<Snapshot<S>>

RelationalSnapshotStore.save