import type { Pool } from 'pg'; import type { JobLogger, JobLogEntry, JobLogQuery, JobLogQueryResult } from 'agenda'; /** * SQL schema for the job logs table. */ export declare function getCreateLogsTableSQL(tableName: string): string; /** * SQL indexes for the job logs table. */ export declare function getCreateLogsIndexesSQL(tableName: string): string[]; /** * PostgreSQL implementation of JobLogger. * Stores job lifecycle events in a dedicated PostgreSQL table. * * @example * ```typescript * // Via backend (automatic connection sharing): * import { PostgresBackend } from '@agendajs/postgres-backend'; * * const backend = new PostgresBackend({ * connectionString: 'postgresql://...', * logging: true // enables PostgresJobLogger with 'agenda_logs' table * }); * * // Standalone (e.g., log to Postgres while using Mongo for storage): * import { PostgresJobLogger } from '@agendajs/postgres-backend'; * import { Pool } from 'pg'; * * const logger = new PostgresJobLogger({ pool: new Pool({ connectionString: '...' }) }); * const agenda = new Agenda({ * backend: new MongoBackend({ address: 'mongodb://...' }), * logging: logger * }); * ``` */ export declare class PostgresJobLogger implements JobLogger { private pool; private readonly tableName; private readonly ensureSchema; private initialized; constructor(options?: { pool?: Pool; tableName?: string; ensureSchema?: boolean; } | string); /** * Set the pool and initialize the table schema. * Called by PostgresBackend after the repository connects, * or automatically when a pool is provided in the constructor. */ setPool(pool: Pool): Promise; private ensureInitialized; log(entry: Omit): Promise; getLogs(query?: JobLogQuery): Promise; clearLogs(query?: JobLogQuery): Promise; private buildWhere; }