Zum Inhalt springen

1 Eintrag aus 1 Quelle. Zuletzt aktualisiert:

Angaben zum Datum

Datum aus der Quelle.

Erstmals gesehen am .

pgx

Pgx 5.11.0: PostgreSQL-Typen direkt scannen und Rows.TypeMap

Pgx 5.11.0 unterstützt unter Go 1.27 über database/sql das direkte Scannen von PostgreSQL-Typen wie Arrays und Ranges per driver.RowsColumnScanner, ergänzt Rows.TypeMap (eigene Rows-Implementierungen müssen die Methode hinzufügen), neue Optionen und Fehler in pgconn und pgxpool sowie bessere Kompatibilität bei libpq-Verbindungsstrings und Datums-/Zeitwerten.

This release adds direct PostgreSQL type scanning through database/sql on Go 1.27, improves compatibility with libpq connection strings and PostgreSQL date/time values, and includes further decoder hardening. See Changes for connection-string and date/time behavior changes that may affect existing applications.

Features

  • stdlib: support Go 1.27's driver.RowsColumnScanner, allowing PostgreSQL types such as arrays and ranges to be scanned directly into Go values without pgtype.Map.SQLScanner. Existing database/sql scalar conversions and sql.Scanner behavior are preserved. The minimum supported Go version remains 1.25.
  • Add Rows.TypeMap to expose the type map used to decode rows, including rows created by RowsFromResultReader that have no underlying Conn. Custom implementations of Rows, including mocks, must add this method.
  • pgconn: add Config.MaxProtocolMessageBodyLen to configure the maximum incoming protocol message body size (carter-ya)
  • pgconn: add ErrReadOnlyConnection, ErrReadWriteConnection, ErrPrimaryConnection, and ErrStandbyConnection sentinel errors for target_session_attrs validation, allowing callers to use errors.Is (Adrian-Stefan Mares)
  • pgxpool: accept pool_ping_timeout in connection strings to configure Config.PingTimeout. The default is zero; zero and negative durations mean no timeout (1991santhu)

Changes …

Originalquelle(öffnet in neuem Tab)Problem melden