@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
md 386 KB

@effect/sql-pg

4.1.2

Patch Changes

4.1.1

Patch Changes

4.1.0

Minor Changes

  • #8829 4f16778 Thanks @effect-bot! - Add the unstable Pool.Stats and Pool.stats APIs for sampling how many pool items are idle or in use and how many borrowers are waiting. PgPool.stats and PgClient.poolStats expose the same snapshot for PostgreSQL sessions, so applications can export connection pool metrics without reaching into pool internals.

Patch Changes

4.0.7

Patch Changes

4.0.6

Patch Changes

  • #9506 679f956 Thanks @tim-smart! - Use Effect.fnUntraced for internal functions that returned Effect.gen.

  • #8676 3da7c0a Thanks @rchasman! - With SpanPropagationEnabled, statement spans record db.client.connection.wait_time_ms, and in @effect/sql-pg a statement that waited for a new session gets a db.connect child span covering the part of the connect it waited for.

  • #9734 4ec78b9 Thanks @effect-bot! - Run PgMigrator schema dumps against the connection PgClient resolves, including url, Unix socket path, application_name, options and TLS verification, and keep the password out of pg_dump arguments. Optional TLS (sslmode=prefer / allow) is dumped with sslmode=verify-full, so dumps from servers that refuse TLS fail.

  • #9222 5a67e0b Thanks @effect-bot! - Fix SqlRunnerStorage hanging on PGlite.

SqlClient now has a driver field identifying the driver that created it, such as "pg", "pglite" or "sqlite-node". Every Effect SQL driver sets it. On PGlite, runner storage no longer reserves the only connection and uses lock table rows instead of advisory locks, so runner and application queries are no longer blocked.

Third-party drivers must pass a driver name to SqlClient.make, and hand-written SqlClient implementations must provide a driver field:

  const make = Effect.gen(function*() {
    return yield* SqlClient.make({
      driver: "my-driver",
      acquirer,
      compiler,
      spanAttributes: []
    })
  })
  • #9641 a9f0ca6 Thanks @effect-bot! - Add an acquireTimeout option to PgClient and PgPool that bounds the wait for a pooled connection, failing with a ConnectionError when the pool stays exhausted.

  • #9738 6e6509e Thanks @effect-bot! - Add an onAcquire option to PgClient that runs an effect in the consuming fiber after each connection checkout. Services it requires become requirements of the client constructor or layer.

The hook runs per checkout, not per socket: idle pooled connections stay open until idleTimeout retires them. - Updated dependencies [ce13a48, f3bbbb4, 5547315, 6093cfb, 30319d5, 74a7596, bfb32a3, f8bf7f4, 7f3d3df, db1046d, 3c4f88a, 916e709, 916f843, 66ec757, daac06f, c2552ec, b02c1cd, 1855f1d, 683ed2c, ac68940, 22a8401, c53c194, ca6d1cc, 47940c5, e8b24ef, 2e8aae0, ad7497b, 7f504a3, 99e365d, 954067d, 3e1a035, 41a1fe7, bcb3a86, 739d3d1, ed4da35, 3d84e19, cc00906, 09ba1f5, 9ff1a73, 06bc532, 97bfd84, 25efaef, c10335b, a808972, 20e844c, b9f73f3, 5739878, 28acdf3, 59b6396, 0bccc9c, fed70de, 82648a2, afb5f32, 28813f5, 0fae934, f260830, 19b63eb, 14db221, 679f956, b72707c, 44c8c1d, 1e7909b, 0611a65, 2fadc65, feb6ce5, 5a2ed53, c8d26a4, 0c8b446, 05c3409, b04191b, 05c3409, 4067e64, e04563d, 02d7fc5, 561d2a1, 8fe2dcc, a8086fa, 88a33b4, e77372a, 3dd4388, ba2b00c, a049d4a, 84aeede, 43e5e19, 77bbf16, 6af3a47, aac8d21, 84c8dc4, 78d1988, 5676a2a, 4b437bf, 1af11fd, 716f8df, ee27718, 4d86d1b, 5462ed7, 658837c, 00261cc, 7cccb93, 7c98228, 5a8e248, 8037a65, 25912db, 7f32606, 0386f88, 403298a, 5a3ebc0, fac2191, fdb12dc, 97909b8, c3983f4, 3a5e65e, 8b40fbc, 3f3e119, 7c7b8ed, d4f71bc, c66241e, f0e941e, 5f8a6e5, 2800a09, e9749b0, eaef09c, a3c56e5, bb61152, e9c842b, 6d8c8e2, 1f28187, 0b9842b, c29ddd8, 84c3405, 3934c0c, 048e7c8, 1121334, 9a680d6, 85e2aee, 34ec440, 343a149, 915117b, 7f823c1, 6e614e6, 9990b39, 22bf781, 41f08b7, e8482ca, 5ae85fa, c477a0a, 8fbb39e, 1c70828, 8207d1e, 7886b84, 4839c60, 2595d83, f5ae278, 7a8ce00, 688d302, c7072e4, 425cedb, 88bc680, 268e09c, 7e94505, afa5da3, c29ddd8, 48102ac, 463eca3, e7162ea, 95752db, 4577a28, 973d599, 2f066a5, f0ccbb6, 2dda6ce, 3da7c0a, 5a67e0b, 73b3a6e, c6f9e4c, be02676, 26de861, 9313799, d5c1e5b, 11bb31f, 8c23e46, 9c96011, 0d50570, 9ed2bf1, 76ec912, af2756d, 3ec8100, 93abf02, 1e94993, 99a4616, 0a7978e, b4a060b, 274f4a4, 25f29be, 9036440, 415f005, 191308b, 4b96570, d84ec3f, 392aa1c, 99e9bd9, 6f6f45f, 13fc07e, a4b38dd, 8b18580, 0c477fe, 9a5331d, a706d73, c9a1e72, 89eaaf8, 8215811, ad69018, a733eba, 7282d5f, da33572, d9e2d12, dc923b8, 1b74086, 8a5507b, 23460fa, 0dbbea6, 70aad3f, 0909236, a9e66d8, ee5c0d5, 631c5d6, 7e60c1a, 4cddd3c, 8727e5d, 2bc97fa, f9a7f05, d978cca, b334ccf, 0b50cfc, 5b7d2b5, 6ee26b1, eab7e6a, e618f10, da14b1f, 3314fc3, 66db624, 4b8a50d, 8d52668, 1de1055, db130e6, 5fa5fa5]: - effect@4.0.6

4.0.5

Patch Changes

4.0.4

Patch Changes

4.0.3

Patch Changes

4.0.2

Patch Changes

4.0.1

Patch Changes

4.0.0

Patch Changes

  • #8633 2c552f2 Thanks @IMax153! - Effect 4.0 is the first stable release of Effect v4. It replaces the 4.0.0 beta and release-candidate series, whose per-release notes remain below under the 4.0.0-beta.* and 4.0.0-rc.* headings. To upgrade from Effect 3, follow the migration guide.

Packaging and versioning

  • All Effect packages share one version number and are released together. Use the same version of effect and every @effect/* package.
  • @effect/platform, @effect/rpc, @effect/cluster, @effect/cli, @effect/ai, @effect/sql, @effect/workflow, @effect/experimental and similar packages are merged into effect. Separate packages remain only for platforms (@effect/platform-*), SQL drivers (@effect/sql-*), AI providers (@effect/ai-*), framework bindings (@effect/atom-*), OpenTelemetry, Vitest and tooling.
  • Modules such as effect/http, effect/http-api, effect/rpc, effect/cluster, effect/workflow, effect/ai, effect/cli, effect/sql and effect/schema import from effect/<area>. APIs tagged @stability unstable may have breaking changes in minor releases. APIs without a stability tag follow semver.
  • APIs that expose a third-party dependency are tagged @stability unstable, because that dependency's releases can change them. This covers NodeRedis, DenoRedis, BunRedis, @effect/platform-node/Undici and the undici dispatcher APIs, the ws options and re-exports in the platform packages, driver-specific options and clients in @effect/sql-clickhouse, @effect/sql-d1, @effect/sql-libsql, @effect/sql-mssql, @effect/sql-mysql2, @effect/sql-pglite and @effect/sql-sqlite-do, the provider clients, models and generated schemas in the @effect/ai-* packages, @effect/opentelemetry, and the vitest re-export in @effect/vitest.
  • effect has no runtime dependencies.
  • New packages in v4: @effect/platform-deno, @effect/sql-pglite, @effect/ai-openai-compat, @effect/ai-typesafe, @effect/atom-react, @effect/atom-solid, @effect/atom-vue, @effect/openapi-generator and @effect/doctest. @effect/docgen now lives in this repository.

Core

  • The fiber runtime was rewritten for lower memory use and faster execution, with smaller bundles and better tree-shaking.
  • Services are defined with Context.Service, FiberRef is replaced by Context.Reference, Cause has a flat structure, and many combinators were renamed. See the migration guide for the full list.
  • Software transactional memory is built into Effect.tx, with TxRef, TxQueue, TxHashMap, TxPubSub, TxSemaphore and related Tx* data types.
  • Clock separates wall-clock time from monotonic time.
  • New modules include Semaphore, Latch, LayerRef, ErrorReporter, ByteSize, Newtype and Crypto. Arbitrary is now a native property-based testing module and no longer depends on fast-check.

Schema

  • Schema v4 is a new implementation with faster parsing, class-based schemas, make constructors on every schema, and effectful decoding with services.
  • SchemaRepresentation powers JSON Schema (Draft-04, Draft-07, 2020-12 and OpenAPI 3.0/3.1) import and export, TypeScript code generation, and AI structured output.
  • SchemaBinary provides a compact binary codec and is the default wire format for cluster transports.
  • Optional JIT and AOT schema compilers are available as experimental modules.

Platform, HTTP and RPC

  • HttpApi supports typed response headers, streaming and SSE responses, the HTTP QUERY method, HttpApiTest for in-memory testing, and much faster type checking for large APIs.
  • The HTTP modules add static file serving, response compression, rate-limited clients and graceful server shutdown.
  • Socket has a pull-based reader with backpressure and STARTTLS support. Network addresses are modeled by effect/net.
  • RPC serialization is schema-aware and supports server-originated requests and notifications.
  • @effect/platform-deno adds full Deno support. The Node, Bun, Deno and browser packages all provide the platform Crypto service, and the browser package adds IndexedDB support.

Cluster and Workflow

  • Workflows can be declared with class syntax, and DurableQueue and an in-memory WorkflowEngine are available.
  • Runner memory can be bounded with ShardingConfig limits. Shutdown, entity movement and persisted replies are more reliable.

SQL

  • @effect/sql-pg uses a built-in PostgreSQL client with pipelining, prepared statements and binary codecs, and no longer depends on pg.
  • @effect/sql-sqlite-node uses Node's built-in node:sqlite and requires Node 22.16 or newer.
  • SqlError exposes structured reasons such as UniqueViolation.

AI

  • effect/ai adds EmbeddingModel, the DecisionModel classification and rating API, dynamic tools and tool approvals.
  • The MCP server supports protocol versions 2024-11-05 through 2026-07-28, including elicitation, sampling with tools, resource subscriptions and typed tool output.
  • Provider packages cover Anthropic, OpenAI, OpenAI-compatible APIs and OpenRouter.

CLI, Atom, observability and testing

  • effect/cli adds global flags, command aliases and examples, an interactive wizard mode, and shell completions for Bash, Zsh and Fish.
  • effect/reactivity and the @effect/atom-* bindings add SSR hydration, stale-while-revalidate atoms and serializable RPC and HttpApi queries.
  • The OTLP exporters can be configured with standard OpenTelemetry environment variables, and @effect/opentelemetry aligns logs and spans with the OpenTelemetry specification.
  • @effect/vitest runs property tests with the native Arbitrary module and supports Vitest fixtures.

Requirements

4.0.0-rc.118

Patch Changes

4.0.0-rc.117

Patch Changes

  • #8309 7869f54 Thanks @tristanz! - Decode binary regclass and regclass[] values as unsigned numeric OIDs, fixing the migration runner's table-existence check. Cast regclass values to text in SQL to return relation names.

  • #8327 201b5ab Thanks @tim-smart! - Namespace prepared statement names per connection to avoid collisions when backend sessions are shared.

  • #8308 106af64 Thanks @tristanz! - Release savepoints after nested transactions succeed or successfully roll back in PostgreSQL, PGlite, MySQL, libSQL, and the Node, Bun, React Native, and WASM SQLite clients. This frees PostgreSQL transaction locks before the outer transaction completes.

Custom SQL clients can opt in through the new releaseSavepoint option. Clients that omit it are unchanged.

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

4.0.0-rc.115

Patch Changes

4.0.0-rc.114

Patch Changes

4.0.0-rc.113

Patch Changes

  • #7426 534b8b9 Thanks @tim-smart! - Replace @effect/sql-pg's pg runtime with a native PostgreSQL client. PgConnection and PgPool now handle connection setup, binary queries, prepared statements, pipelining, streaming, notifications, cancellation, and custom codecs. PgConnection.listen and PgClient.listen return scoped notification dequeues after PostgreSQL confirms the subscription. PgClient uses the native stack, and the legacy fromPool, fromClient, and makeWith constructors are removed.

### Breaking changes

  • fromPool, fromClient, and makeWith are removed. Use make for a pool or makeClient for one connection.
  • PgClient.listen returns a scoped Effect<Dequeue<string>, SqlError, Scope> instead of a Stream. Acquisition completes after PostgreSQL confirms LISTEN, so notifications sent after it returns cannot be missed.
  • PgClientConfig.types now accepts a PgTypes.Registry instead of pg.CustomTypesConfig. Plain object parameters are no longer inferred as JSON; wrap them with sql.json.
  • Query strings must contain one statement. PostgreSQL's extended protocol rejects multi-statement strings.
  • Results use the native binary codecs. In particular, int8 decodes to bigint, date to a string, timestamps to Unix epoch milliseconds, and bytea or unknown OIDs to Uint8Array. executeRaw returns the native PgConnection.Result shape rather than pg.Result.
  • Named prepared statements are enabled by default. Set prepare: false when using a pooler that cannot preserve prepared statements between queries. Statement.unprepared and Statement.valuesUnprepared use unnamed extended queries without adding entries to the prepared-statement cache.

Inferred parameters stay permissive: strings bind untyped so the backend derives the type from the statement, and safe integers beyond the int4 range bind as int8.

Add Pool.reserve for exclusive access to a concurrent pool item, and fix waiter wakeups and capacity replacement after invalidation.

  • #7509 c405edc Thanks @tim-smart! - Set the default multiplexConcurrency to 32 when PostgreSQL connection multiplexing is enabled. Set a lower value explicitly to limit how many statements share each connection.

  • #7503 96ea948 Thanks @tim-smart! - Allow each PostgreSQL pool connection to complete its first checkout before applying connectionTTL, so a zero TTL disables connection reuse without entering an invalidate/reconnect loop.

  • #7502 e203638 Thanks @tim-smart! - Add a maxMessageSize connection option so PostgreSQL clients can receive backend messages larger than the 16 MiB default.

  • #7524 0a08ae0 Thanks @fubhy! - Add NetAddress under effect/unstable/net for MAC, IP, internet socket, and Unix socket addresses, with checked parsing, schemas, equality, canonical string serialization, and URL formatting. Companion modules IpInterface and IpNetwork represent IP interfaces and CIDR networks.

HTTP and socket servers now expose NetAddress.SocketAddress. Replace TCP hostname access with NetAddress.formatIp(address.address) and use UnixPathAddress.path for Unix sockets. URL helpers bracket IPv6 addresses and reject scoped IPv6. Bun and Deno HTTP server layers can now fail with ServeError when listener address conversion fails.

PostgreSQL inet values now use IpInterface; cidr values use IpNetwork and reject addresses with host bits set.

4.0.0-rc.112

Patch Changes

  • #7391 1144032 Thanks @tim-smart! - Add low-level PostgreSQL protocol, binary type, and authentication codecs to @effect/sql-pg.

PgProtocol encodes protocol 3.0 messages and incrementally parses backend frames. Its stateful parser throws terminal errors. PgTypes handles binary scalar and one-dimensional array OIDs; its public codecs return typed Result failures, while parser field readers use an internal throwing fast path. PgAuth implements MD5 and SCRAM-SHA-256 with typed Result failures.

Encoded frames and decoded byte fields are stable views over internal buffers. Copy data that must outlive its message. PgClient remains unchanged and still uses pg at runtime. - Updated dependencies [20cb4f2, 44675cb, b6bf5e1, 0b9f780, 150e92c, 6740db2, d57bba1, be75d5e, be75d5e, be75d5e, 02a5146, 15272a6, 436f10d, 058fb15, 4d89bb8, 480fb15, f77ec19, 925b82a, 7455246, 118124d, a5f78d3, 0dd7825, b722eca, 811d579, 043b587, 8583727, d9d2cfc, 5c4b7a0]: - effect@4.0.0-rc.112

4.0.0-rc.111

Patch Changes

4.0.0-rc.110

Patch Changes

4.0.0-rc.109

Patch Changes

4.0.0-rc.108

Patch Changes

4.0.0-beta.107

Patch Changes

4.0.0-beta.106

Patch Changes

4.0.0-beta.105

Patch Changes

4.0.0-beta.104

Patch Changes

4.0.0-beta.103

Patch Changes

4.0.0-beta.102

Patch Changes

4.0.0-beta.101

Patch Changes

4.0.0-beta.100

Patch Changes

4.0.0-beta.99

Patch Changes

4.0.0-beta.98

Patch Changes

4.0.0-beta.97

Patch Changes

4.0.0-beta.96

Patch Changes

4.0.0-beta.95

Patch Changes

4.0.0-beta.94

Patch Changes

4.0.0-beta.93

Patch Changes

4.0.0-beta.92

Patch Changes

4.0.0-beta.91

Patch Changes

4.0.0-beta.90

Patch Changes

4.0.0-beta.89

Patch Changes

4.0.0-beta.88

Patch Changes

4.0.0-beta.87

Patch Changes

4.0.0-beta.86

Patch Changes

4.0.0-beta.85

Patch Changes

4.0.0-beta.84

Patch Changes

4.0.0-beta.83

Patch Changes

4.0.0-beta.82

Patch Changes

4.0.0-beta.81

Patch Changes

4.0.0-beta.80

Patch Changes

4.0.0-beta.79

Patch Changes

4.0.0-beta.78

Patch Changes

4.0.0-beta.77

Patch Changes

4.0.0-beta.76

Patch Changes

4.0.0-beta.75

Patch Changes

4.0.0-beta.74

Patch Changes

4.0.0-beta.73

Patch Changes

4.0.0-beta.72

Patch Changes

4.0.0-beta.71

Patch Changes

4.0.0-beta.70

Patch Changes

4.0.0-beta.69

Patch Changes

4.0.0-beta.68

Patch Changes

4.0.0-beta.67

Patch Changes

4.0.0-beta.66

Patch Changes

4.0.0-beta.65

Patch Changes

  • #2148 6f11454 Thanks @tim-smart! - Add UniqueViolation as a new SQL error reason. Supported unique constraint violations now classify as UniqueViolation instead of the broader ConstraintError reason.

This covers PostgreSQL, PGlite, MySQL, MSSQL, and the shared SQLite classification used by the SQLite-family clients. UniqueViolation.constraint contains the best available constraint, index, or key identifier and falls back to exactly "unknown" when no reliable identifier is available.

4.0.0-beta.64

Patch Changes

4.0.0-beta.63

Patch Changes

4.0.0-beta.62

Patch Changes

4.0.0-beta.61

Patch Changes

4.0.0-beta.60

Patch Changes

4.0.0-beta.59

Patch Changes

4.0.0-beta.58

Patch Changes

4.0.0-beta.57

Patch Changes

4.0.0-beta.56

Patch Changes

4.0.0-beta.55

Patch Changes

4.0.0-beta.54

Patch Changes

4.0.0-beta.53

Patch Changes

4.0.0-beta.52

Patch Changes

4.0.0-beta.51

Patch Changes

4.0.0-beta.50

Patch Changes

4.0.0-beta.49

Patch Changes

4.0.0-beta.48

Patch Changes

4.0.0-beta.47

Patch Changes

4.0.0-beta.46

Patch Changes

4.0.0-beta.45

Patch Changes

4.0.0-beta.44

Patch Changes

4.0.0-beta.43

Patch Changes

4.0.0-beta.42

Patch Changes

4.0.0-beta.41

Patch Changes

4.0.0-beta.40

Patch Changes

4.0.0-beta.39

Patch Changes

4.0.0-beta.38

Patch Changes

4.0.0-beta.37

Patch Changes

4.0.0-beta.36

Patch Changes

4.0.0-beta.35

Patch Changes

4.0.0-beta.34

Patch Changes

4.0.0-beta.33

Patch Changes

4.0.0-beta.32

Patch Changes

4.0.0-beta.31

Patch Changes

4.0.0-beta.30

Patch Changes

4.0.0-beta.29

Patch Changes

4.0.0-beta.28

Patch Changes

4.0.0-beta.27

Patch Changes

4.0.0-beta.26

Patch Changes

4.0.0-beta.25

Patch Changes

4.0.0-beta.24

Patch Changes

4.0.0-beta.23

Patch Changes

4.0.0-beta.22

Patch Changes

4.0.0-beta.21

Patch Changes

4.0.0-beta.20

Patch Changes

4.0.0-beta.19

Patch Changes

4.0.0-beta.18

Patch Changes

4.0.0-beta.17

Patch Changes

4.0.0-beta.16

Patch Changes

4.0.0-beta.15

Patch Changes

4.0.0-beta.14

Patch Changes

4.0.0-beta.13

Patch Changes

4.0.0-beta.12

Patch Changes

4.0.0-beta.11

Patch Changes

4.0.0-beta.10

Patch Changes

4.0.0-beta.9

Patch Changes

4.0.0-beta.8

Patch Changes

4.0.0-beta.7

Patch Changes

4.0.0-beta.6

Patch Changes

4.0.0-beta.5

Patch Changes

4.0.0-beta.4

Patch Changes

4.0.0-beta.3

Patch Changes

4.0.0-beta.2

Patch Changes

4.0.0-beta.1

Patch Changes

4.0.0-beta.0

Major Changes

Patch Changes

0.45.1

Patch Changes

0.45.0

Patch Changes

0.44.0

Patch Changes

0.43.0

Minor Changes

  • #5192 17a5ea8 Thanks @nikelborm! - Updated deprecated OTel Resource attributes names and values.

Many of the attributes have undergone the process of deprecation not once, but twice. Most of the constants holding attribute names have been renamed. These are minor changes.

Additionally, there were numerous changes to the attribute keys themselves. These changes can be considered major.

In the @opentelemetry/semantic-conventions package, new attributes having ongoing discussion about them are going through a process called incubation, until a consensus about their necessity and form is reached. Otel team recommends devs to copy them directly into their code. Luckily, it's not necessary because all of the new attribute names and values came out of this process (some of them were changed again) and are now considered stable.

## Reasoning for minor version bump

| Package | Major attribute changes | Major value changes | | -------------------------- | ----------------------------------------------------------------------------- | --------------------------------- | | Clickhouse client | db.system -> db.system.name
db.name -> db.namespace | | | MsSQL client | db.system -> db.system.name
db.name -> db.namespace | mssql -> microsoft.sql_server | | MySQL client | db.system -> db.system.name
db.name -> db.namespace | | | Pg client | db.system -> db.system.name
db.name -> db.namespace | | | Bun SQLite client | db.system -> db.system.name | | | Node SQLite client | db.system -> db.system.name | | | React.Native SQLite client | db.system -> db.system.name | | | Wasm SQLite client | db.system -> db.system.name | | | SQLite Do client | db.system -> db.system.name | | | LibSQL client | db.system -> db.system.name | | | D1 client | db.system -> db.system.name | | | Kysely client | db.statement -> db.query.text | | | @effect/sql | db.statement -> db.query.text
db.operation -> db.operation.name | |

Patch Changes

0.42.0

Patch Changes

0.41.14

Patch Changes

0.41.13

Patch Changes

0.41.12

Patch Changes

0.41.11

Patch Changes

0.41.10

Patch Changes

0.41.9

Patch Changes

0.41.8

Patch Changes

0.41.7

Patch Changes

0.41.6

Patch Changes

0.41.5

Patch Changes

0.41.4

Patch Changes

0.41.3

Patch Changes

0.41.2

Patch Changes

0.41.1

Patch Changes

0.41.0

Patch Changes

0.40.0

Patch Changes

0.39.2

Patch Changes

0.39.1

Patch Changes

0.39.0

Patch Changes

0.38.12

Patch Changes

0.38.11

Patch Changes

0.38.10

Patch Changes

0.38.9

Patch Changes

0.38.8

Patch Changes

0.38.7

Patch Changes

0.38.6

Patch Changes

0.38.5

Patch Changes

0.38.4

Patch Changes

0.38.3

Patch Changes

0.38.2

Patch Changes

0.38.1

Patch Changes

0.38.0

Patch Changes

0.37.0

Patch Changes

0.36.8

Patch Changes

0.36.7

Patch Changes

0.36.6

Patch Changes

0.36.5

Patch Changes

0.36.4

Patch Changes

0.36.3

Patch Changes

0.36.2

Patch Changes

0.36.1

Patch Changes

0.36.0

Patch Changes

0.35.1

Patch Changes

0.35.0

Patch Changes

0.34.21

Patch Changes

0.34.20

Patch Changes

0.34.19

Patch Changes

0.34.18

Patch Changes

0.34.17

Patch Changes

0.34.16

Patch Changes

0.34.15

Patch Changes

0.34.14

Patch Changes

0.34.13

Patch Changes

0.34.12

Patch Changes

0.34.11

Patch Changes

0.34.10

Patch Changes

0.34.9

Patch Changes

0.34.8

Patch Changes

0.34.7

Patch Changes

0.34.6

Patch Changes

0.34.5

Patch Changes

0.34.4

Patch Changes

0.34.3

Patch Changes

0.34.2

Patch Changes

0.34.1

Patch Changes

0.34.0

Minor Changes

  • #4469 3131f8f Thanks @tim-smart! - refactor of @effect/cluster packages

Patch Changes

0.33.4

Patch Changes

0.33.3

Patch Changes

0.33.2

Patch Changes

0.33.1

Patch Changes

0.33.0

Patch Changes

0.32.1

Patch Changes

0.32.0

Patch Changes

0.31.7

Patch Changes

0.31.6

Patch Changes

0.31.5

Patch Changes

0.31.4

Patch Changes

0.31.3

Patch Changes

0.31.2

Patch Changes

0.31.1

Patch Changes

0.31.0

Patch Changes

0.30.1

Patch Changes

0.30.0

Patch Changes

0.29.4

Patch Changes

0.29.3

Patch Changes

0.29.2

Patch Changes

0.29.1

Patch Changes

0.29.0

Patch Changes

0.28.0

Patch Changes

0.27.1

Patch Changes

0.27.0

Patch Changes

0.26.2

Patch Changes

0.26.1

Patch Changes

0.26.0

Patch Changes

0.25.3

Patch Changes

0.25.2

Patch Changes

0.25.1

Patch Changes

0.25.0

Patch Changes

0.24.4

Patch Changes

0.24.3

Patch Changes

  • #4143 f7f2dd6 Thanks @tim-smart! - add timeout to sql connection attempts

0.24.2

Patch Changes

0.24.1

Patch Changes

0.24.0

Patch Changes

0.23.7

Patch Changes

0.23.6

Patch Changes

0.23.5

Patch Changes

0.23.4

Patch Changes

0.23.3

Patch Changes

0.23.2

Patch Changes

0.23.1

Patch Changes

0.23.0

Patch Changes

0.22.4

Patch Changes

0.22.3

Patch Changes

0.22.2

Patch Changes

0.22.1

Patch Changes

0.22.0

Minor Changes

  • #4022 1b1ba09 Thanks @tim-smart! - allow cloning a SqlClient with transforms disabled

Patch Changes

0.21.12

Patch Changes

0.21.11

Patch Changes

0.21.10

Patch Changes

0.21.9

Patch Changes

0.21.8

Patch Changes

0.21.7

Patch Changes

0.21.6

Patch Changes

0.21.5

Patch Changes

0.21.4

Patch Changes

0.21.3

Patch Changes

0.21.2

Patch Changes

0.21.1

Patch Changes

0.21.0

Patch Changes

0.20.0

Patch Changes

0.19.5

Patch Changes

0.19.4

Patch Changes

0.19.3

Patch Changes

0.19.2

Patch Changes

0.19.1

Patch Changes

0.19.0

Minor Changes

  • #3852 70dd4d7 Thanks @sukovanej! - Use layer / layerConfig naming convention for the /sql-* packages. Make layer constructors accept a raw config object. Add layerConfig constructors that accept Config.Config<...>.

Patch Changes

0.18.10

Patch Changes

0.18.9

Patch Changes

0.18.8

Patch Changes

0.18.7

Patch Changes

0.18.6

Patch Changes

0.18.5

Patch Changes

0.18.4

Patch Changes

0.18.3

Patch Changes

0.18.2

Patch Changes

0.18.1

Patch Changes

0.18.0

Patch Changes

0.17.0

Minor Changes

  • #3760 dacbf7d Thanks @tim-smart! - add sql-clickhouse & clickhouse dialect

Patch Changes

0.16.6

Patch Changes

0.16.5

Patch Changes

0.16.4

Patch Changes

0.16.3

Patch Changes

0.16.2

Patch Changes

0.16.1

Patch Changes

0.16.0

Patch Changes

0.15.2

Patch Changes

  • #3744 9fef880 Thanks @tim-smart! - test sql connection as part of client construction

0.15.1

Patch Changes

0.15.0

Patch Changes

0.14.1

Patch Changes

0.14.0

Patch Changes

0.13.4

Patch Changes

0.13.3

Patch Changes

0.13.2

Patch Changes

0.13.1

Patch Changes

0.13.0

Patch Changes

0.12.6

Patch Changes

0.12.5

Patch Changes

0.12.4

Patch Changes

0.12.3

Patch Changes

0.12.2

Patch Changes

0.12.1

Patch Changes

0.12.0

Patch Changes

0.11.3

Patch Changes

0.11.2

Patch Changes

0.11.1

Patch Changes

0.11.0

Patch Changes

0.10.4

Patch Changes

0.10.3

Patch Changes

0.10.2

Patch Changes

0.10.1

Patch Changes

0.10.0

Patch Changes

0.9.7

Patch Changes

0.9.6

Patch Changes

0.9.5

Patch Changes

0.9.4

Patch Changes

0.9.3

Patch Changes

0.9.2

Patch Changes

0.9.1

Patch Changes

0.9.0

Minor Changes

  • #3457 a07990d Thanks @IMax153! - Add support for executing raw SQL queries with the underlying SQL client.

This is primarily useful when the SQL client returns special results for certain query types.

For example, because MySQL does not support the RETURNING clause, the mysql2 client will return a ResultSetHeader for INSERT, UPDATE, DELETE, and TRUNCATE operations.

To gain access to the raw results of a query, you can use the .raw property on the Statement:

  import * as Effect from "effect/Effect";
  import * as MysqlClient from "effect/unstable/sql/MysqlClient";
  import * as SqlClient from "effect/unstable/sql/SqlClient";

  const DatabaseLive = MysqlClient.layer({
    database: Config.succeed("database"),
    username: Config.succeed("root"),
    password: Config.succeed(Redacted.make("password")),
  });

  const program = Effect.gen(function* () {
    const sql = yield* SqlClient.SqlClient;

    const result = yield* sql`INSERT INTO usernames VALUES ("Bob")`.raw;

    console.log(result);
    /**
     * ResultSetHeader {
     *   fieldCount: 0,
     *   affectedRows: 1,
     *   insertId: 0,
     *   info: '',
     *   serverStatus: 2,
     *   warningStatus: 0,
     *   changedRows: 0
     * }
     */
  });

  program.pipe(Effect.provide(DatabaseLive), Effect.runPromise);

Patch Changes

0.8.7

Patch Changes

0.8.6

Patch Changes

0.8.5

Patch Changes

0.8.4

Patch Changes

0.8.3

Patch Changes

0.8.2

Patch Changes

0.8.1

Patch Changes

0.8.0

Patch Changes

0.7.0

Patch Changes

0.6.3

Patch Changes

0.6.2

Patch Changes

0.6.1

Patch Changes

0.6.0

Patch Changes

0.5.3

Patch Changes

0.5.2

Patch Changes

0.5.1

Patch Changes

0.5.0

Minor Changes

  • #3260 53c0db0 Thanks @tim-smart! - replace /platform RefailError with use of the "cause" property

Patch Changes

0.4.27

Patch Changes

0.4.26

Patch Changes

0.4.25

Patch Changes

0.4.24

Patch Changes

0.4.23

Patch Changes

0.4.22

Patch Changes

0.4.21

Patch Changes

0.4.20

Patch Changes

0.4.19

Patch Changes

0.4.18

Patch Changes

0.4.17

Patch Changes

0.4.16

Patch Changes

0.4.15

Patch Changes

0.4.14

Patch Changes

0.4.13

Patch Changes

0.4.12

Patch Changes

0.4.11

Patch Changes

0.4.10

Patch Changes

0.4.9

Patch Changes

0.4.8

Patch Changes

0.4.7

Patch Changes

0.4.6

Patch Changes

0.4.5

Patch Changes

0.4.4

Patch Changes

0.4.3

Patch Changes

0.4.2

Patch Changes

0.4.1

Patch Changes

0.4.0

Minor Changes

  • #3035 d33d8b0 Thanks @tim-smart! - restructure sql modules to have flat imports

Patch Changes

0.3.19

Patch Changes

0.3.18

Patch Changes

0.3.17

Patch Changes

0.3.16

Patch Changes

0.3.15

Patch Changes

0.3.14

Patch Changes

0.3.13

Patch Changes

0.3.12

Patch Changes

0.3.11

Patch Changes

0.3.10

Patch Changes

0.3.9

Patch Changes

0.3.8

Patch Changes

0.3.7

Patch Changes

0.3.6

Patch Changes

0.3.5

Patch Changes

0.3.4

Patch Changes

0.3.3

Patch Changes

0.3.2

Patch Changes

0.3.1

Patch Changes

  • #2838 bf66289 Thanks @tim-smart! - allow additional span attributes to be passed to sql clients

0.3.0

Minor Changes

  • #2833 af0543c Thanks @tim-smart! - remove file system migrator from web sql implementations

Patch Changes

0.2.17

Patch Changes

0.2.16

Patch Changes

0.2.15

Patch Changes

0.2.14

Patch Changes

0.2.13

Patch Changes

0.2.12

Patch Changes

0.2.11

Patch Changes

0.2.10

Patch Changes

0.2.9

Patch Changes

0.2.8

Patch Changes

0.2.7

Patch Changes

0.2.6

Patch Changes

0.2.5

Patch Changes

0.2.4

Patch Changes

0.2.3

Patch Changes

0.2.2

Patch Changes

0.2.1

Patch Changes

0.2.0

Minor Changes

All of the client implementations now share the same Context.Tag. This means you can create services that support multiple SQL flavors.

You can now use the @effect/sql package to access the client apis:

  import { Effect } from "effect";
  import * as Sql from "effect/unstable/sql";

  Effect.gen(function* () {
    const sql = yield* Sql.client.Client;
    yield* sql`SELECT * FROM users`;
  });

If you need a functionality that is specific to a implementation, you can use the tag from the implementation package:

  import * as Sqlite from "@effect/sql-sqlite-node";
  import { Effect } from "effect";

  Effect.gen(function* () {
    const sql = yield* Sqlite.client.SqliteClient;
    const dump = yield* sql.export;
  });

If you need to run a different query depending on the dialect, you can use the sql.onDialect api:

  import { Effect } from "effect";
  import * as Sql from "effect/unstable/sql";

  Effect.gen(function* () {
    const sql = yield* Sql.client.Client;
    yield* sql.onDialect({
      sqlite: () => sql`SELECT * FROM sqlite_master`,
      mysql: () => sql`SHOW TABLES`,
      mssql: () => sql`SELECT * FROM sys.tables`,
      pg: () => sql`SELECT * FROM pg_catalog.pg_tables`,
    });
  });

Patch Changes

0.1.17

Patch Changes

0.1.16

Patch Changes

0.1.15

Patch Changes

0.1.14

Patch Changes

0.1.13

Patch Changes

0.1.12

Patch Changes

0.1.11

Patch Changes

0.1.10

Patch Changes

0.1.9

Patch Changes

0.1.8

Patch Changes

0.1.7

Patch Changes

0.1.6

Patch Changes

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

Patch Changes