@codeforbreakfast/eventsourcing-store-postgres
Version: 
Production-ready PostgreSQL event store with Effect integration - Scalable, ACID-compliant event persistence with type-safe database operations and streaming
34 lines • 1.49 kB
TypeScript
import { PgClient } from '@effect/sql-pg';
import { Context, Effect, Layer } from 'effect';
import { EventStoreConnectionError } from '@codeforbreakfast/eventsourcing-store';
declare const ConnectionManager_base: Context.TagClass<ConnectionManager, "ConnectionManager", {
    /**
     * Get dedicated connection for LISTEN operations
     */
    readonly getListenConnection: Effect.Effect<PgClient.PgClient, EventStoreConnectionError, never>;
    /**
     * Execute health check on listening connection
     */
    readonly healthCheck: Effect.Effect<void, EventStoreConnectionError, never>;
    /**
     * Gracefully close the listen connection
     */
    readonly shutdown: Effect.Effect<void, EventStoreConnectionError, never>;
}>;
/**
 * ConnectionManager service for managing PostgreSQL notification connections
 */
export declare class ConnectionManager extends ConnectionManager_base {
}
/**
 * Implementation of ConnectionManager service
 * Creates a robust persistent connection specifically for LISTEN/NOTIFY operations
 * This uses the main PgClient from the layer, so it inherits the same configuration
 */
export declare const ConnectionManagerLive: Layer.Layer<ConnectionManager, EventStoreConnectionError, PgClient.PgClient>;
/**
 * Wraps an effect with automatic health checks and retry policy
 */
export declare const withConnectionHealth: <A, R>(self: Effect.Effect<A, unknown, R>) => Effect.Effect<A, unknown, R>;
export {};
//# sourceMappingURL=connectionManager.d.ts.map