/** * PostgreSQL Core Tools - Error Parser * * Maps raw PostgreSQL error codes and messages to structured, * high-signal error messages with actionable guidance. * * Split from error-helpers.ts for modularity. */ import type { ErrorContext } from "../../../../types/error-types.js"; export type { ErrorContext } from "../../../../types/error-types.js"; /** * Parse a raw PostgreSQL error and return a structured Error with * actionable guidance. Non-PG errors (connection refused, auth, etc.) * are re-thrown unchanged to preserve their original stack trace. * * Supported PG error codes: * - 42P01: undefined_table (relation does not exist) * - 42P07: duplicate_table (relation already exists) * - 42P06: duplicate_schema (schema already exists) * - 42704: undefined_object (index/type does not exist) * - 42601: syntax_error (SQL syntax error) * - 42703: undefined_column (column does not exist) * - 23505: unique_violation (duplicate key value) * - 23503: foreign_key_violation (FK constraint violated) * - 3F000: invalid_schema_name (schema does not exist) * - 3D000: invalid_catalog_name (database does not exist) * - 3B001: savepoint_exception (savepoint does not exist) * - 25P02: in_failed_sql_transaction (transaction is aborted) */ export declare function parsePostgresError(error: unknown, context: ErrorContext): Error; //# sourceMappingURL=error-parser.d.ts.map