longcelot-sheet-db
Version:
Google Sheets-backed staging database adapter for Node.js with schema-first design
25 lines • 1.28 kB
TypeScript
import { ActorPermission } from '../../schema/types';
import { SQLAdapterBase } from './sqlAdapterBase';
export interface PostgresAdapterConfig {
/** e.g. postgres://user:pass@host:5432/db. Ignored if `pool` is provided. Falls back to $DATABASE_URL. */
connectionString?: string;
/** Pass a pre-built pg.Pool instead of letting this adapter construct one. */
pool?: unknown;
/**
* Overrides the automatic SSL detection (on for any non-localhost connectionString, off for
* localhost/127.0.0.1) — see resolvePostgresSSL(). Ignored if `pool` is provided.
*/
ssl?: boolean | {
rejectUnauthorized: boolean;
};
/** Column injected into every non-admin table to scope rows to a tenant. Default: 'tenant_id'. */
tenantColumn?: string;
permissions?: Record<string, ActorPermission>;
}
/**
* `pg` is an optional peer dependency, lazy-required only here so `import { createSheetAdapter }
* from 'longcelot-sheet-db'` never pulls it in transitively for consumers who only use Sheets
* (Phase 16.2). Throws a clear SchemaError — not a raw module-not-found — when it's missing.
*/
export declare function createPostgresAdapter(config: PostgresAdapterConfig): SQLAdapterBase;
//# sourceMappingURL=postgresAdapter.d.ts.map