/** * PostgreSQL Performance Tools - Shared Helpers * * Common utilities shared across performance stat modules. */ import type { PostgresAdapter } from "../../postgres-adapter.js"; /** Helper to handle undefined params (allows tools to be called without {}) */ export declare const defaultToEmpty: (val: unknown) => unknown; /** Helper to coerce string numbers to JavaScript numbers (PostgreSQL returns BIGINT as strings) */ export declare const toNum: (val: unknown) => number | null; /** * P507: Coerce string-typed numbers to actual numbers for z.preprocess(). * Returns undefined for non-numeric strings so .optional() defaults kick in. * Prevents NaN leaking into SQL via z.coerce.number(). */ export declare const coerceNumber: (val: unknown) => unknown; /** * P154: Validate that a table/schema exists before executing performance queries. * Throws a ValidationError so the handler's catch block routes through * formatHandlerErrorResponse(), ensuring code/category/recoverable fields * are included in the structured error response. * * Call inside the handler's try/catch BEFORE executing the main query. */ export declare function validatePerformanceTableExists(adapter: PostgresAdapter, table?: string, schema?: string): Promise; //# sourceMappingURL=helpers.d.ts.map