Documentation
¶
Overview ¶
Package sqlerr carries a PostgreSQL SQLSTATE alongside an error message.
Wadjet speaks the PostgreSQL wire protocol, and a client branches on the SQLSTATE it is handed: 42P01 sends it to re-resolve a table name, 42703 to re-resolve a column, 22012 to report a data error. Before this package every failure crossed the wire as the blanket class 42000 (#366), because the planner and engine produced plain errors and the pgwire layer had nothing to extract a code from.
An error created here travels through ordinary %w wrapping; the pgwire layer recovers the code with StateOf. Errors defined elsewhere can participate without importing this package by implementing the Coder interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coder ¶
type Coder interface {
SQLState() string
}
Coder is implemented by error types that know their own SQLSTATE but do not depend on this package (e.g. expr.UnknownFuncError).