/** * PostgreSQL pg_partman Extension Tools - Shared Helpers * * Common utilities used by partman operation and maintenance tools. */ import type { PostgresAdapter } from "../../postgres-adapter.js"; /** * Default row limit for partman list/analysis tools. * Shared across show_partitions, show_config, and analyze_partition_health. */ export declare const DEFAULT_PARTMAN_LIMIT = 50; /** * Validate a pg_partman table name before interpolation into SQL. * * pg_partman's function-call syntax requires string interpolation for named * arguments (`p_parent_table := 'schema.table'`), which cannot use $1 params. * This helper rejects names containing single quotes or semicolons to mitigate * injection risk in that narrow context. */ export declare function sanitizePartmanTableName(tableName: string): string; /** * Detect the schema where pg_partman is installed. * Newer versions install to 'public' by default, older versions use 'partman'. */ export declare function getPartmanSchema(adapter: PostgresAdapter): Promise; /** * Ensure the 'partman' schema alias exists when pg_partman is installed in 'public'. * * pg_partman's partition_data_time function contains a hardcoded fully-qualified * call to 'partman.check_control_type(...)'. When pg_partman is installed in * the 'public' schema (the default for newer versions), this fails with * 'schema "partman" does not exist'. Since the reference is fully-qualified, * SET search_path cannot resolve it. * * This function creates the 'partman' schema if needed and adds a thin wrapper * function that delegates to public.check_control_type(). */ export declare function ensurePartmanSchemaAlias(adapter: PostgresAdapter, partmanSchema: string): Promise; /** * Execute a pg_partman PROCEDURE, ensuring schema aliases are in place. */ export declare function callPartmanProcedure(adapter: PostgresAdapter, partmanSchema: string, sql: string): Promise; /** * Check if a table exists in information_schema to provide standard P154 TABLE_NOT_FOUND errors */ export declare function checkTableExists(adapter: PostgresAdapter, tableWithSchema: string): Promise; //# sourceMappingURL=helpers.d.ts.map