/** * postgres-mcp — Schema Operations: Describe * * Types, pure parsing helpers, and the `queryDescribeTable` function * for detailed table inspection (columns, indexes, constraints, foreign keys). */ import type { QueryResult, TableInfo } from "../../../types/index.js"; /** * A function that executes SQL and returns rows. * Matches PostgresAdapter.executeQuery signature. */ export type QueryExecutor = (sql: string, params?: unknown[]) => Promise; /** * Cache helpers, matching the getCached/setCache interface on PostgresAdapter. */ export interface CacheHelpers { getCached(key: string): unknown; setCache(key: string, data: unknown): void; } /** * Parse columns from PostgreSQL array format. * Handles both native arrays and string representations like "{col1,col2}". */ export declare function parseColumnsArray(columns: unknown): string[]; /** * Extract expression columns from index definition when column names are NULL. * Expression indexes (like LOWER(name)) have attnum=0 which returns NULL from pg_attribute. * This parses the index definition to extract the actual expressions. */ export declare function extractIndexColumns(columns: string[], definition: string): string[]; /** * Extract the column expression part from an index definition, handling nested parentheses. * E.g., "CREATE INDEX idx ON tbl USING btree (lower(name))" → "lower(name)" */ export declare function extractIndexExpressionPart(definition: string): string | null; /** * Parse index expressions from the column list, handling nested parentheses. * E.g., "LOWER(name), id, UPPER(TRIM(email))" → ["LOWER(name)", "id", "UPPER(TRIM(email))"] */ export declare function parseIndexExpressions(columnList: string): string[]; /** * Describe a single table with columns, indexes, constraints, and foreign keys. */ export declare function queryDescribeTable(executeQuery: QueryExecutor, cache: CacheHelpers, tableName: string, schemaName?: string): Promise; //# sourceMappingURL=describe.d.ts.map