import { Pool } from 'pg'; import { BaseKeyValueStorage, type BaseKeyValueStorageRow } from './BaseKeyValueStorage'; export interface PostgresKeyValueStorageOptions { connectionString: string; tableName?: string; namespace?: string; /** * 共享的 pg Pool 实例(避免多个组件创建独立连接池导致死锁) * 如果提供,将忽略 connectionString */ pool?: Pool; } export declare class PostgresKeyValueStorage extends BaseKeyValueStorage { private readonly pool; private readonly quotedTableName; private readonly sharedConnectionString?; constructor(options: PostgresKeyValueStorageOptions); protected closeStorage(): Promise; protected hasValue(key: string): Promise; protected selectValue(key: string): Promise; protected upsertValue(key: string, payload: string): Promise; protected deleteValue(key: string): Promise; protected selectEntries(prefix: string): Promise; private ensureTable; }