Skip to main content

Module sqlstate

Module sqlstate 

Source
Expand description

SQLSTATE code mapping for Krishiv SQL errors.

Maps SqlError variants to the 5-character SQLSTATE codes defined by ISO/IEC 9075 (SQL standard) and widely adopted by JDBC/ODBC drivers. Clients can surface these codes over the Flight SQL wire protocol in the grpc-status-details trailer.

Structs§

SqlStateError
A structured error envelope carrying the SQLSTATE code alongside the original error message. Suitable for embedding in Flight SQL or JDBC error responses.

Constants§

DATA_EXCEPTION
22000 — Data exception (general).
FEATURE_NOT_SUPPORTED
0A000 — Feature not supported.
GENERAL_ERROR
HY000 — General error (catch-all for driver-level errors).
INSUFFICIENT_PRIVILEGE
42501 — Insufficient privilege.
INTERNAL_ERROR
XX000 — Internal error (engine fault).
INVALID_AUTHORIZATION
28000 — Invalid authorisation specification (access denied).
QUERY_CANCELLED
57014 — Query cancelled (due to operator or timeout).
QUERY_TIMEOUT
57P05 — Query execution timeout.
SUCCESS
00000 — Successful completion.
SYNTAX_ERROR
42000 — Syntax error or access rule violation.
SYSTEM_ERROR
58000 — System error (external component failure).
UNDEFINED_TABLE
42P01 — Undefined table.

Functions§

sqlstate_for
Return the SQLSTATE code for the given SqlError.