@flow-state-dev/store-postgres
Interfaces
PoolConfig
Extends
ClientConfig
Properties
allowExitOnIdle?
allowExitOnIdle?: boolean;
application_name?
application_name?: string;
Inherited from
ClientConfig.application_name
Client?
Client?: new () => ClientBase;
Returns
ClientBase
client_encoding?
client_encoding?: string;
Inherited from
ClientConfig.client_encoding
connectionString?
connectionString?: string;
Inherited from
ClientConfig.connectionString
connectionTimeoutMillis?
connectionTimeoutMillis?: number;
Inherited from
ClientConfig.connectionTimeoutMillis
database?
database?: string;
Inherited from
ClientConfig.database
fallback_application_name?
fallback_application_name?: string;
Inherited from
ClientConfig.fallback_application_name
host?
host?: string;
Inherited from
ClientConfig.host
idle_in_transaction_session_timeout?
idle_in_transaction_session_timeout?: number;
Inherited from
ClientConfig.idle_in_transaction_session_timeout
idleTimeoutMillis?
idleTimeoutMillis?: number | null;
keepAlive?
keepAlive?: boolean;
Inherited from
ClientConfig.keepAlive
keepAliveInitialDelayMillis?
keepAliveInitialDelayMillis?: number;
Inherited from
ClientConfig.keepAliveInitialDelayMillis
lock_timeout?
lock_timeout?: number;
Inherited from
ClientConfig.lock_timeout
log?
log?: (...messages) => void;
Parameters
messages
...any[]
Returns
void
max?
max?: number;
maxLifetimeSeconds?
maxLifetimeSeconds?: number;
maxUses?
maxUses?: number;
min?
min?: number;
onConnect?
onConnect?: (client) => void;
Parameters
client
ClientBase
Returns
void
options?
options?: string;
Inherited from
ClientConfig.options
password?
password?: string | (() => string | Promise<string>);
Inherited from
ClientConfig.password
port?
port?: number;
Inherited from
ClientConfig.port
Promise?
Promise?: PromiseConstructorLike;
query_timeout?
query_timeout?: number;
Inherited from
ClientConfig.query_timeout
ssl?
ssl?: boolean | ConnectionOptions;
Inherited from
ClientConfig.ssl
statement_timeout?
statement_timeout?: number | false;
Inherited from
ClientConfig.statement_timeout
stream?
stream?: () => Duplex | undefined;
Returns
Duplex | undefined
Inherited from
ClientConfig.stream
types?
types?: CustomTypesConfig;
Inherited from
ClientConfig.types
user?
user?: string;
Inherited from
ClientConfig.user
Type Aliases
PostgresStoreOptions
type PostgresStoreOptions = CommonPostgresStoreOptions & (
| {
pool: Pool;
}
| {
connectionString?: string;
connectionTimeoutMillis?: number;
createPool?: (config) => Pool;
idleTimeoutMillis?: number;
max?: number;
poolOptions?: PoolConfig;
}
| {
executor: QueryExecutor;
});
Functions
createPostgresScheduleIndex()
function createPostgresScheduleIndex(executor): ScheduleIndex;
Build a ScheduleIndex backed by the schedule_index table.
The executor must implement beginTx() — claimDue uses
SELECT ... FOR UPDATE SKIP LOCKED which requires a pinned
connection. Pool-backed executors from createPostgresStores
satisfy this; custom executors must implement it themselves.
Parameters
executor
Returns
ScheduleIndex
postgresStores()
function postgresStores(options): StoreAdapter;
Postgres store adapter for createFlowState. Backs the primary and bus
capability slots: with no bus named in the profile, the Postgres bus
carries change notices between processes. Wraps createPostgresStores,
memoizing the registry so lazy resolution opens the pool once, and
disposes it via close().
Parameters
options
Returns
StoreAdapter