/** * PostgreSQL Document Store - Shared Helpers * * Utilities for document collection tools: identifier validation, * filter parsing, collection existence checks, and table reference escaping. */ import type { PostgresAdapter } from "../../postgres-adapter.js"; export declare const IDENTIFIER_RE: RegExp; export declare const JSON_PATH_RE: RegExp; /** * Parse filter string into a WHERE clause with parameterized queries. * Supports: * - _id match: 32-char hex string → WHERE _id = $1 * - JSON object: {"name":"Alice"} → WHERE doc->>'name' = $1 * - Field equality: name=Alice → WHERE doc->>'name' = $1 * - JSON path existence: $.name → WHERE doc ? 'name' */ export declare function parseDocFilter(filter: string, paramOffset?: number): { where: string; params: unknown[]; }; /** * Check if a collection (table with doc JSONB + _id column) exists. * Returns a discriminated result distinguishing schema-not-found from collection-not-found. */ export declare function checkCollectionExists(adapter: PostgresAdapter, collection: string, schema?: string): Promise<{ exists: true; } | { exists: false; reason: "schema" | "collection"; name: string; }>; /** * Build a double-quoted PostgreSQL table reference. */ export declare function escapeTableRef(name: string, schema?: string): string; //# sourceMappingURL=helpers.d.ts.map