@arturwojnar/hermes-postgresql
Version:
Production-Ready TypeScript Outbox Pattern for PostgreSQL
13 lines (12 loc) • 551 B
TypeScript
import { Sql } from 'postgres';
import { AsyncOrSync } from 'ts-essentials';
import { type Lsn } from './lsn.js';
import { EventEnvelope } from './types.js';
type LogicalReplicationState = {
lastProcessedLsn: Lsn;
timestamp: Date;
publication: string;
slotName: string;
};
declare const startLogicalReplication: <Event>(state: LogicalReplicationState, sql: Sql, publish: (event: EventEnvelope<Event> | EventEnvelope<Event>[]) => AsyncOrSync<void> | never) => Promise<void>;
export { LogicalReplicationState, startLogicalReplication };