Documentation
¶
Overview ¶
Package postgres implements a verify.Verifier for PostgreSQL using the pgx native driver (github.com/jackc/pgx/v5). It provides full origin-trace and type refinement per RFC 0004:
- Each query is prepared via pgx.Conn.Prepare, which returns pgconn.StatementDescription with typed FieldDescriptions.
- DataTypeOID is resolved to a pg type name via a pg_type cache built once per connection.
- When TableOID != 0, (TableOID, TableAttributeNumber) is resolved to (table, column) via pg_class/pg_attribute (lazily cached).
- The resulting verify.Column carries DeclType (the pg type name), TableName, and OriginName when available, so the overlay can apply the UseDeclType path for expression/aggregate columns.
MySQL origin ¶
MySQL does not surface reliable origin information via the standard database/sql ColumnType; see internal/verify/mysql for the type-only refinement path.
Integration tests ¶
The live connect/prepare path is integration-only and is skipped when DB_CATALYST_VERIFY_DSN is unset. The core mapping logic (fieldsToColumns) is fully unit-tested with constructed fakes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FieldLike ¶
type FieldLike interface {
ColName() string // result column name
TblOID() uint32 // origin table OID; 0 for expressions
AttNum() uint16 // attribute number within the table; 0 for expressions
DTypeOID() uint32 // data type OID
}
FieldLike abstracts one result-column description so that fieldsToColumns can be unit-tested with constructed fakes without a live pgx connection.