Skip to content
English

PostgresSnapshotStoreOptionsType

Defined in: src/persistence/snapshot-stores/PostgresSnapshotStoreOptions.ts:4

Connection options shared by all three Postgres stores.

readonly optional autoCreateTables?: boolean

Defined in: src/persistence/snapshot-stores/PostgresSnapshotStoreOptions.ts:10

Run CREATE TABLE IF NOT EXISTS on first use. Default: true.


readonly optional keepN?: number

Defined in: src/persistence/snapshot-stores/PostgresSnapshotStoreOptions.ts:8

Keep this many snapshots per persistenceId; older ones pruned on save. Default: 3. <=0 keeps all.


readonly optional pool?: PgPoolLike

Defined in: src/persistence/journals/PostgresClient.ts:60

Pre-built pool — bypasses the lazy pg import entirely. Use to share ONE pool across the journal + snapshot + durable-state stores (see registerPostgresPlugins), or to inject a fake in tests.

PostgresConnection.pool


readonly optional poolConfig?: Record<string, unknown>

Defined in: src/persistence/journals/PostgresClient.ts:54

Extra node-postgres Pool config, merged over { connectionString: url } — e.g. { max: 10, ssl: { rejectUnauthorized: false } }.

PostgresConnection.poolConfig


readonly optional serializer?: Serializer<unknown>

Defined in: src/persistence/storage/StoreSerializerOptions.ts:23

Custom payload serializer. When set, the store writes rows in the self-describing __serialized__ framing (see PayloadCodec) instead of the default tagged JSON; rows of both formats can coexist in one stream, but reading a framed row back requires a serializer with the same id to be configured.

StoreSerializerOptionsBase.serializer


readonly optional snapshotsTable?: string

Defined in: src/persistence/snapshot-stores/PostgresSnapshotStoreOptions.ts:6

Snapshots table name. Default: snapshots.


readonly optional url?: string

Defined in: src/persistence/journals/PostgresClient.ts:49

Connection string, e.g. postgres://user:pass@host:5432/db.

PostgresConnection.url