github Effect-TS/effect @effect/sql-pg@4.0.0-rc.116

Patch Changes

  • #8215 9367dcb Thanks @hsyntax! - Preserve the original SqlError when a PostgreSQL LISTEN connection fails after registration, allowing Stream.retry to acquire a new listener. Intentional scope closure still interrupts consumers.

    Notification queues returned by PgClient.listen and PgConnection.listen now carry SqlError. Update explicit queue and stream type annotations to include this error.

  • #8200 8feeb3c Thanks @tim-smart! - Support sslmode=prefer and sslmode=allow by trying TLS first, then plaintext if the server declines SSLRequest. Unlike libpq, allow also tries TLS first. Explicit ssl overrides and certificate verification are unchanged. TLS handshake and certificate failures remain fatal. Cancellation never downgrades a TLS session to plaintext.

  • #8234 4e4a3a6 Thanks @tim-smart! - Add structured startupParameters and opaque startupOptions to connection config, and restore support for URL options. Explicit startupOptions overrides URL options; the startup packet field remains options. Send session defaults in every physical connection's startup packet, including pooled replacements, with config validation and documented application-name precedence.

  • #8224 205066a Thanks @alvarosevilla95! - Support infallible Effect password providers with no service requirements, refreshed per PostgreSQL connection and schema dump.

  • #8241 8ef3fcb Thanks @tim-smart! - Decode timestamp and timestamptz values, including array elements, as Date instead of epoch milliseconds. Their encoders, including PgTypes.timestamp and PgTypes.timestamptz, accept either form. Precision remains milliseconds.

    Breaking changes

    • Numeric readers must call date.getTime() or restore numeric codecs with PgTypes.register or a client Registry passed as types.
    • infinity, -infinity and values outside the JavaScript Date range decode to an invalid Date. Numeric ±Infinity still encodes PostgreSQL's sentinels; encoding an invalid Date fails with PgTypes.CodecError.

    Date parameters bind as timestamptz. Inserting one into a timestamp column applies the session TimeZone. Use UTC or PgTypes.timestamp(value) to preserve its UTC fields. timestamptz round trips preserve the instant regardless of session timezone.

  • #8240 fd910d1 Thanks @tim-smart! - Decode unregistered OIDs as UTF-8 text so scalar enums return string labels.

    Other binary user-defined types, including enum arrays, may produce garbled text or fail UTF-8 decoding. Decode failures close the connection, failing its pending queries and discarding transactions and LISTEN subscriptions; the pool replaces it.

    Register scalar codecs with PgTypes.register. For arrays, use PgTypes.makeRegistry().register(elementOid, codec, { arrayOid }) and pass the registry as the client's types option.

  • Updated dependencies [c19c63f, 8cb0a4f, 8f420bb, 1393080, ccae354, 553c403, 45b5103, 77a5612, 1076170, f110af1, 0045152, 51d4a2f, 4d4c4e8, ccfe152, d30a0c8, 84fe64a, 49e4b37, 49e4b37, a2c4154, 23a58c0, feef90c, 755e863, 49e4b37, 9ad9891, 0beded0, 2940742, 63c1566]:

    • effect@4.0.0-rc.116

Don't miss a new effect release

NewReleases is sending notifications on new releases.