//#region src/errors.d.ts interface SqlDriverError { readonly kind: Kind; } /** * SQL query error for query-related failures (syntax errors, constraint violations, permissions). */ declare class SqlQueryError extends Error implements SqlDriverError<'sql_query'> { static readonly ERROR_NAME: "SqlQueryError"; readonly kind: "sql_query"; readonly sqlState: string | undefined; readonly constraint: string | undefined; readonly table: string | undefined; readonly column: string | undefined; readonly detail: string | undefined; constructor(message: string, options?: { readonly cause?: Error; readonly sqlState?: string; readonly constraint?: string; readonly table?: string; readonly column?: string; readonly detail?: string; }); /** * Type predicate to check if an error is a SqlQueryError. */ static is(error: unknown): error is SqlQueryError; } /** * SQLSTATE for a unique-constraint / primary-key violation — the SQL-standard * `unique_violation` class. Drivers normalize their target-specific codes (e.g. * Postgres `23505`, SQLite `SQLITE_CONSTRAINT_UNIQUE`/`PRIMARYKEY`) onto this * value on {@link SqlQueryError.sqlState}, so consumers classify violations * without knowing any target-specific error shape. */ declare const UNIQUE_VIOLATION_SQLSTATE = "23505"; /** * Whether an error is a unique-constraint (or primary-key) violation, decided * solely from the driver-normalized {@link SqlQueryError.sqlState}. Raw driver * errors that were never normalized are not classified — callers run behind the * driver, which always normalizes before the error escapes. */ declare function isUniqueConstraintViolation(error: unknown): boolean; /** * SQL connection error (timeouts, connection resets, etc.). */ declare class SqlConnectionError extends Error implements SqlDriverError<'sql_connection'> { static readonly ERROR_NAME: "SqlConnectionError"; readonly kind: "sql_connection"; readonly transient: boolean | undefined; constructor(message: string, options?: { readonly cause?: Error; readonly transient?: boolean; }); /** * Type predicate to check if an error is a SqlConnectionError. */ static is(error: unknown): error is SqlConnectionError; } //#endregion export { SqlConnectionError, SqlQueryError, UNIQUE_VIOLATION_SQLSTATE, isUniqueConstraintViolation }; //# sourceMappingURL=index.d.mts.map