gizmodel/sql/errors
Protocol representations have one owner; no diagnostic text classifies a failure.
import * as Errors from "gizmodel/sql/errors";Functions
sqlstate
function sqlstate(error: DbError): stringThe SQLSTATE code of ERROR.
Effects: fail, alloc.
oracleCode
function oracleCode(error: DbError): i64The Oracle error number of ERROR, or 0 when it has none.
Effects: fail, alloc.
sqlcodeOf
function sqlcodeOf(error: DbError): i64The SQLCODE of ERROR, as PL/SQL reports it.
Effects: fail, alloc.
messageNumber
function messageNumber(text: string): i64The number of a PL/SQL compile message: PLS-00201 is 201, "PL/SQL: ORA-00984: ..." is 984, other texts 0.
Effects: fail, alloc.
predefinedNumber
function predefinedNumber(name: string): i64The Oracle error number of a predefined exception (PL/SQL's STANDARD package), or 0.
Effects: fail, alloc.
conditionState
function conditionState(name: string): stringThe SQLSTATE a condition name stands for (PostgreSQL's names and Oracle's predefined ones).
Effects: fail, alloc.
postgresMessage
function postgresMessage(error: DbError): stringPostgreSQL's text for ERROR when the engine words it as SQLite does (no such table, NOT NULL constraint failed); "" for the rest. The engine's own texts stay: its callers match them (bind.giz), and other dialects show them.
Effects: fail, alloc.
oracleMessage
function oracleMessage(error: DbError): stringThe Oracle message text of ERROR (ORA-NNNNN), or "" when it has no Oracle number.
Effects: fail, alloc.
Constants
SQLSTATE_DUPLICATE_PREPARED
const SQLSTATE_DUPLICATE_PREPARED = "42P05"The SQLSTATE of a prepared statement whose name is already in use.
SQLSTATE_EXCEPTION
const SQLSTATE_EXCEPTION = "P0001"The SQLSTATE of an exception that a program raised.