From ee10dc9d05e0e794dc5f7c8e72a73051628bbaa4 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 6 Nov 2026 09:08:56 +1300 Subject: [PATCH] Update migration guidance for SQL driver clients no longer extending SqlClient (#10403) --- migration/annotations/effect__STM.yaml | 4 ++ .../effect__ai-openai__Generated.yaml | 3 ++ .../effect__platform__HttpApiMiddleware.yaml | 3 ++ .../effect__rpc__RpcMiddleware.yaml | 3 ++ ...ect__sql-clickhouse__ClickhouseClient.yaml | 2 +- .../annotations/effect__sql-d1__D1Client.yaml | 3 ++ .../effect__sql-libsql__LibsqlClient.yaml | 3 ++ .../effect__sql-mssql__MssqlClient.yaml | 2 +- .../effect__sql-mysql2__MysqlClient.yaml | 3 ++ .../annotations/effect__sql-pg__PgClient.yaml | 2 +- .../effect__sql-sqlite-bun__SqliteClient.yaml | 2 +- .../effect__sql-sqlite-do__SqliteClient.yaml | 3 ++ ...effect__sql-sqlite-node__SqliteClient.yaml | 2 +- ...sql-sqlite-react-native__SqliteClient.yaml | 3 ++ ...effect__sql-sqlite-wasm__SqliteClient.yaml | 2 +- .../annotations/effect__sql__SqlClient.yaml | 2 +- migration/v3-to-v4.md | 46 +++++++++++++++---- 17 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 migration/annotations/effect__sql-libsql__LibsqlClient.yaml diff --git a/migration/annotations/effect__STM.yaml b/migration/annotations/effect__STM.yaml index 78bdade90f..5df8c6deb5 100644 --- a/migration/annotations/effect__STM.yaml +++ b/migration/annotations/effect__STM.yaml @@ -214,6 +214,10 @@ effect/STM#matchSTM: effect/STM#mergeAll: replacement: "Effect.reduce" note: "Reduce the input Effects sequentially and combine each produced value with the accumulator." +effect/STM#negate: + replacement: "Effect.map" + note: "STM values are now ordinary Effects and there is no negate combinator; map the boolean with Boolean.not. Run the complete transaction with Effect.tx." + example: "Effect.map(self, Boolean.not)" effect/STM#none: replacement: "Effect.matchEffect + Option.match" note: "Recreate the Option success/error shuffle explicitly; no dedicated helper remains." diff --git a/migration/annotations/effect__ai-openai__Generated.yaml b/migration/annotations/effect__ai-openai__Generated.yaml index 6dc8673e8b..e911e583fc 100644 --- a/migration/annotations/effect__ai-openai__Generated.yaml +++ b/migration/annotations/effect__ai-openai__Generated.yaml @@ -3100,6 +3100,9 @@ "@effect/ai-openai/Generated#SubmitToolOutputsRunRequest": replacement: "Generated.SubmitToolOutputsRunRequest" note: "Still generated in v4 from the current OpenAI specification; re-check the schema's Type/Encoded shape because the generated definition changed." +"@effect/ai-openai/Generated#Summary": + replacement: "Generated.SummaryTextContent" + note: "Reasoning summary parts are generated as SummaryTextContent. It is a Schema.Struct rather than a class, so type must be supplied as \"summary_text\" instead of defaulting in a constructor." "@effect/ai-openai/Generated#SummaryTextContent": replacement: "Generated.SummaryTextContent" note: "Still generated in v4 from the current OpenAI specification; re-check the schema's Type/Encoded shape because the generated definition changed." diff --git a/migration/annotations/effect__platform__HttpApiMiddleware.yaml b/migration/annotations/effect__platform__HttpApiMiddleware.yaml index 48150b2559..f43455652a 100644 --- a/migration/annotations/effect__platform__HttpApiMiddleware.yaml +++ b/migration/annotations/effect__platform__HttpApiMiddleware.yaml @@ -31,6 +31,9 @@ "@effect/platform/HttpApiMiddleware#TagClass": replacement: "effect/http-api/HttpApiMiddleware#ServiceClass" note: "Renamed class type with the new two-stage type configuration and wrapping service shape." +"@effect/platform/HttpApiMiddleware#TagClass.Base": + replacement: "effect/http-api/HttpApiMiddleware#ServiceClass" + note: "The shared base interface was folded into ServiceClass; there is no separate public base interface." "@effect/platform/HttpApiMiddleware#TagClass.BaseSecurity": replacement: "effect/http-api/HttpApiMiddleware#ServiceClass" note: "Security is conditional metadata on ServiceClass; there is no separate public base interface." diff --git a/migration/annotations/effect__rpc__RpcMiddleware.yaml b/migration/annotations/effect__rpc__RpcMiddleware.yaml index 1f70aea0a3..831f9e5853 100644 --- a/migration/annotations/effect__rpc__RpcMiddleware.yaml +++ b/migration/annotations/effect__rpc__RpcMiddleware.yaml @@ -13,6 +13,9 @@ "@effect/rpc/RpcMiddleware#TagClass": replacement: "effect/rpc/RpcMiddleware#ServiceClass" note: "Renamed class type for the v4 Context.Service-based middleware declaration." +"@effect/rpc/RpcMiddleware#TagClass.Base": + replacement: "effect/rpc/RpcMiddleware#ServiceClass" + note: "The shared base interface was folded into ServiceClass; there is no separate public base interface." "@effect/rpc/RpcMiddleware#TagClass.Failure": replacement: "effect/rpc/RpcMiddleware#Error" note: "Failure terminology became error; apply the extractor to the middleware ID." diff --git a/migration/annotations/effect__sql-clickhouse__ClickhouseClient.yaml b/migration/annotations/effect__sql-clickhouse__ClickhouseClient.yaml index 2453212dd3..5f83c00e7c 100644 --- a/migration/annotations/effect__sql-clickhouse__ClickhouseClient.yaml +++ b/migration/annotations/effect__sql-clickhouse__ClickhouseClient.yaml @@ -1,6 +1,6 @@ "@effect/sql-clickhouse/ClickhouseClient#ClickhouseClient": replacement: "@effect/sql-clickhouse/ClickhouseClient#ClickhouseClient" - note: "Retained; the service value is now a Context.Service rather than a GenericTag." + note: "Retained; the service value is now a Context.Service rather than a GenericTag. The ClickhouseClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives ClickhouseClient & SqlClient, but an effect that requires ClickhouseClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies ClickhouseClient. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-clickhouse/ClickhouseClient#currentClickhouseSettings": replacement: "@effect/sql-clickhouse/ClickhouseClient#ClickhouseSettings" note: "Renamed and changed from FiberRef to Context.Reference; prefer client.withClickhouseSettings or provide the reference as a service." diff --git a/migration/annotations/effect__sql-d1__D1Client.yaml b/migration/annotations/effect__sql-d1__D1Client.yaml index a73f163586..c9ef338dd1 100644 --- a/migration/annotations/effect__sql-d1__D1Client.yaml +++ b/migration/annotations/effect__sql-d1__D1Client.yaml @@ -1,3 +1,6 @@ +"@effect/sql-d1/D1Client#D1Client": + replacement: "@effect/sql-d1/D1Client#D1Client" + note: "Retained; the service value is now a Context.Service, and v4 adds batch for atomic D1 batches. The D1Client interface no longer extends SqlClient.SqlClient. Yielding the service still gives D1Client & SqlClient, but an effect that requires D1Client no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies D1Client. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-d1/D1Client#D1ClientConfig": replacement: "@effect/sql-d1/D1Client#D1ClientConfig" note: "Retained; prepareCacheTTL now uses Duration.Input." diff --git a/migration/annotations/effect__sql-libsql__LibsqlClient.yaml b/migration/annotations/effect__sql-libsql__LibsqlClient.yaml new file mode 100644 index 0000000000..c436299616 --- /dev/null +++ b/migration/annotations/effect__sql-libsql__LibsqlClient.yaml @@ -0,0 +1,3 @@ +"@effect/sql-libsql/LibsqlClient#LibsqlClient": + replacement: "@effect/sql-libsql/LibsqlClient#LibsqlClient" + note: "Retained; the service value is now a Context.Service. The LibsqlClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives LibsqlClient & SqlClient, but an effect that requires LibsqlClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies LibsqlClient. Annotate a layer chosen between drivers as Layer.Layer." diff --git a/migration/annotations/effect__sql-mssql__MssqlClient.yaml b/migration/annotations/effect__sql-mssql__MssqlClient.yaml index 31b4626f01..811bb94685 100644 --- a/migration/annotations/effect__sql-mssql__MssqlClient.yaml +++ b/migration/annotations/effect__sql-mssql__MssqlClient.yaml @@ -1,6 +1,6 @@ "@effect/sql-mssql/MssqlClient#MssqlClient": replacement: "@effect/sql-mssql/MssqlClient#MssqlClient" - note: "Retained; the service value is now a Context.Service rather than a GenericTag." + note: "Retained; the service value is now a Context.Service rather than a GenericTag. The MssqlClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives MssqlClient & SqlClient, but an effect that requires MssqlClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies MssqlClient. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-mssql/MssqlClient#MssqlClientConfig": replacement: "@effect/sql-mssql/MssqlClient#MssqlClientConfig" note: "Retained; durations use Duration.Input, parameterTypes is keyed by Statement.PrimitiveKind, and v4 adds retry and timeout options." diff --git a/migration/annotations/effect__sql-mysql2__MysqlClient.yaml b/migration/annotations/effect__sql-mysql2__MysqlClient.yaml index 817cc7ed05..41cec753ed 100644 --- a/migration/annotations/effect__sql-mysql2__MysqlClient.yaml +++ b/migration/annotations/effect__sql-mysql2__MysqlClient.yaml @@ -1,3 +1,6 @@ +"@effect/sql-mysql2/MysqlClient#MysqlClient": + replacement: "@effect/sql-mysql2/MysqlClient#MysqlClient" + note: "Retained; the service value is now a Context.Service. The MysqlClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives MysqlClient & SqlClient, but an effect that requires MysqlClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies MysqlClient. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-mysql2/MysqlClient#MysqlClientConfig": replacement: "@effect/sql-mysql2/MysqlClient#MysqlClientConfig" note: "Retained; connectionTTL uses Duration.Input and v4 adds disablePreparedStatements." diff --git a/migration/annotations/effect__sql-pg__PgClient.yaml b/migration/annotations/effect__sql-pg__PgClient.yaml index 5e850eb656..476d929b42 100644 --- a/migration/annotations/effect__sql-pg__PgClient.yaml +++ b/migration/annotations/effect__sql-pg__PgClient.yaml @@ -6,7 +6,7 @@ note: "Wrapping an existing node-pg Pool was removed. Provide connection settings to PgClient.layer instead." "@effect/sql-pg/PgClient#PgClient": replacement: "@effect/sql-pg/PgClient#PgClient" - note: "Retained; the service value is now a Context.Service. The listen method returns a scoped Effect acquiring a Queue.Dequeue; consume it with Queue operations or Stream.fromQueue and read each notification's payload. Connection failures after registration fail the queue with the original SqlError; scope closure interrupts consumers." + note: "Retained; the service value is now a Context.Service. The listen method returns a scoped Effect acquiring a Queue.Dequeue; consume it with Queue operations or Stream.fromQueue and read each notification's payload. Connection failures after registration fail the queue with the original SqlError; scope closure interrupts consumers. The PgClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives PgClient & SqlClient, but an effect that requires PgClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies PgClient. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-pg/PgClient#PgClientConfig": include: true replacement: "@effect/sql-pg/PgClient#PgClientConfig / PgPoolConfig" diff --git a/migration/annotations/effect__sql-sqlite-bun__SqliteClient.yaml b/migration/annotations/effect__sql-sqlite-bun__SqliteClient.yaml index e26cfe0b84..846e675ca3 100644 --- a/migration/annotations/effect__sql-sqlite-bun__SqliteClient.yaml +++ b/migration/annotations/effect__sql-sqlite-bun__SqliteClient.yaml @@ -1,6 +1,6 @@ "@effect/sql-sqlite-bun/SqliteClient#SqliteClient": replacement: "@effect/sql-sqlite-bun/SqliteClient#SqliteClient" - note: "Retained; the service value is now a Context.Service." + note: "Retained; the service value is now a Context.Service. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-sqlite-bun/SqliteClient#make": include: true replacement: "SqliteClient.make" diff --git a/migration/annotations/effect__sql-sqlite-do__SqliteClient.yaml b/migration/annotations/effect__sql-sqlite-do__SqliteClient.yaml index aabf0cd667..7b99cc6529 100644 --- a/migration/annotations/effect__sql-sqlite-do__SqliteClient.yaml +++ b/migration/annotations/effect__sql-sqlite-do__SqliteClient.yaml @@ -1,3 +1,6 @@ +"@effect/sql-sqlite-do/SqliteClient#SqliteClient": + replacement: "@effect/sql-sqlite-do/SqliteClient#SqliteClient" + note: "Retained; the service value is now a Context.Service. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-sqlite-do/SqliteClient#SqliteClientConfig": replacement: "@effect/sql-sqlite-do/SqliteClient#SqliteClientConfig" note: "Retained; db is optional and storage may be supplied, but one of db or storage is required at runtime." diff --git a/migration/annotations/effect__sql-sqlite-node__SqliteClient.yaml b/migration/annotations/effect__sql-sqlite-node__SqliteClient.yaml index 974a676ee9..c4adc0d550 100644 --- a/migration/annotations/effect__sql-sqlite-node__SqliteClient.yaml +++ b/migration/annotations/effect__sql-sqlite-node__SqliteClient.yaml @@ -1,6 +1,6 @@ "@effect/sql-sqlite-node/SqliteClient#SqliteClient": replacement: "@effect/sql-sqlite-node/SqliteClient#SqliteClient" - note: "Retained on node:sqlite, but the byte-export member was removed; use backup(destination) for file backup." + note: "Retained on node:sqlite, but the byte-export member was removed; use backup(destination) for file backup. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-sqlite-node/SqliteClient#SqliteClientConfig": replacement: "@effect/sql-sqlite-node/SqliteClient#SqliteClientConfig" note: "Retained; prepareCacheTTL now uses Duration.Input." diff --git a/migration/annotations/effect__sql-sqlite-react-native__SqliteClient.yaml b/migration/annotations/effect__sql-sqlite-react-native__SqliteClient.yaml index d46613df65..ba1cd6bef3 100644 --- a/migration/annotations/effect__sql-sqlite-react-native__SqliteClient.yaml +++ b/migration/annotations/effect__sql-sqlite-react-native__SqliteClient.yaml @@ -1,3 +1,6 @@ +"@effect/sql-sqlite-react-native/SqliteClient#SqliteClient": + replacement: "@effect/sql-sqlite-react-native/SqliteClient#SqliteClient" + note: "Retained; the service value is now a Context.Service. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer." "@effect/sql-sqlite-react-native/SqliteClient#asyncQuery": replacement: "@effect/sql-sqlite-react-native/SqliteClient#AsyncQuery" note: "Renamed and changed from FiberRef to Context.Reference; prefer withAsyncQuery or provide AsyncQuery as a service." diff --git a/migration/annotations/effect__sql-sqlite-wasm__SqliteClient.yaml b/migration/annotations/effect__sql-sqlite-wasm__SqliteClient.yaml index 64cf9a2ff8..045d98fd8c 100644 --- a/migration/annotations/effect__sql-sqlite-wasm__SqliteClient.yaml +++ b/migration/annotations/effect__sql-sqlite-wasm__SqliteClient.yaml @@ -3,4 +3,4 @@ note: "Renamed and changed from FiberRef to Context.Reference; prefer withTransferables or provide Transferables as a service." "@effect/sql-sqlite-wasm/SqliteClient#SqliteClient": replacement: "@effect/sql-sqlite-wasm/SqliteClient#SqliteClient" - note: "Retained with the same export/import surface; the service value is now a Context.Service." + note: "Retained with the same export/import surface; the service value is now a Context.Service. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer." diff --git a/migration/annotations/effect__sql__SqlClient.yaml b/migration/annotations/effect__sql__SqlClient.yaml index 505aeeff73..52e06d9856 100644 --- a/migration/annotations/effect__sql__SqlClient.yaml +++ b/migration/annotations/effect__sql__SqlClient.yaml @@ -7,7 +7,7 @@ "@effect/sql/SqlClient#SqlClient": include: true replacement: "effect/sql/SqlClient#SqlClient" - note: "Moved into core Effect. Custom service implementations must expose driver and afterCommit; SqlClient.make supplies both. driver identifies the driver independently of its SQL dialect. afterCommit registers effects to run after the outermost successful commit and connection release attempt, discarding rolled-back work. withTransaction now also defers contextual Reactivity.invalidate and mutation invalidations until that commit. Transactions bypassing makeWithTransaction, such as sqlite-do transactions, run callbacks and invalidations immediately." + note: "Moved into core Effect. Custom service implementations must expose driver and afterCommit; SqlClient.make supplies both. driver identifies the driver independently of its SQL dialect. afterCommit registers effects to run after the outermost successful commit and connection release attempt, discarding rolled-back work. withTransaction now also defers contextual Reactivity.invalidate and mutation invalidations until that commit. Transactions bypassing makeWithTransaction, such as sqlite-do transactions, run callbacks and invalidations immediately. Driver-specific client interfaces should extend SqlClient.Base rather than SqlClient, so providing a generic SqlClient does not also remove the driver requirement." "@effect/sql/SqlClient#makeWithTransaction": include: true replacement: "effect/sql/SqlClient#makeWithTransaction" diff --git a/migration/v3-to-v4.md b/migration/v3-to-v4.md index 6f57d5bbb6..916789a566 100644 --- a/migration/v3-to-v4.md +++ b/migration/v3-to-v4.md @@ -4,7 +4,7 @@ Base: `cab7f2e3493e4a3dceda27cb1b6d28c4599cb939` (`cab7f2e3493e4a3dceda27cb1b6d28c4599cb939`) -Head: `origin/main` (`27d644e4b6f3dc02e5e2a06e8ce2b912595772c9`) +Head: `origin/main` (`cb679e39cabeeadc5b40a5e20da311b9e4054a1b`) This file is generated from the API diff and `migration/annotations/*.yaml`. @@ -3592,6 +3592,8 @@ effect/rpc/Utils (barrel: effect/rpc) - `Generated.SubmitToolOutputsRunRequest` -> `Generated.SubmitToolOutputsRunRequest`: Still generated in v4 from the current OpenAI specification; re-check the schema's Type/Encoded shape because the generated definition changed. +- `Generated.Summary` -> `Generated.SummaryTextContent`: Reasoning summary parts are generated as SummaryTextContent. It is a Schema.Struct rather than a class, so type must be supplied as "summary\_text" instead of defaulting in a constructor. + - `Generated.SummaryTextContent` -> `Generated.SummaryTextContent`: Still generated in v4 from the current OpenAI specification; re-check the schema's Type/Encoded shape because the generated definition changed. - `Generated.SummaryTextContentType` -> `none`: Removed when the OpenAI specification client was regenerated; use the current Generated or OpenAiSchema request/response schema for the relevant endpoint instead of this old snapshot helper. @@ -6926,6 +6928,8 @@ effect/rpc/Utils (barrel: effect/rpc) - `HttpApiMiddleware.TagClass` -> `effect/http-api/HttpApiMiddleware#ServiceClass`: Renamed class type with the new two-stage type configuration and wrapping service shape. +- `HttpApiMiddleware.TagClass.Base` -> `effect/http-api/HttpApiMiddleware#ServiceClass`: The shared base interface was folded into ServiceClass; there is no separate public base interface. + - `HttpApiMiddleware.TagClass.BaseSecurity` -> `effect/http-api/HttpApiMiddleware#ServiceClass`: Security is conditional metadata on ServiceClass; there is no separate public base interface. - `HttpApiMiddleware.TagClass.Failure` -> `effect/http-api/HttpApiMiddleware#Error`: failure terminology became error; apply the extractor to the middleware ID. @@ -7886,6 +7890,8 @@ effect/rpc/Utils (barrel: effect/rpc) - `RpcMiddleware.TagClass` -> `effect/rpc/RpcMiddleware#ServiceClass`: Renamed class type for the v4 Context.Service-based middleware declaration. +- `RpcMiddleware.TagClass.Base` -> `effect/rpc/RpcMiddleware#ServiceClass`: The shared base interface was folded into ServiceClass; there is no separate public base interface. + - `RpcMiddleware.TagClass.Failure` -> `effect/rpc/RpcMiddleware#Error`: Failure terminology became error; apply the extractor to the middleware ID. - `RpcMiddleware.TagClass.FailureContext` -> `effect/rpc/RpcMiddleware#ErrorServicesEncode / ErrorServicesDecode`: The single schema context split into server encoding and client decoding services. @@ -7974,7 +7980,7 @@ effect/rpc/Utils (barrel: effect/rpc) ### `@effect/sql-clickhouse/ClickhouseClient` -- `ClickhouseClient.ClickhouseClient` -> `@effect/sql-clickhouse/ClickhouseClient#ClickhouseClient`: Retained; the service value is now a Context.Service rather than a GenericTag. +- `ClickhouseClient.ClickhouseClient` -> `@effect/sql-clickhouse/ClickhouseClient#ClickhouseClient`: Retained; the service value is now a Context.Service rather than a GenericTag. The ClickhouseClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives ClickhouseClient & SqlClient, but an effect that requires ClickhouseClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies ClickhouseClient. Annotate a layer chosen between drivers as Layer.Layer\. - `ClickhouseClient.currentClickhouseSettings` -> `@effect/sql-clickhouse/ClickhouseClient#ClickhouseSettings`: Renamed and changed from FiberRef to Context.Reference; prefer client.withClickhouseSettings or provide the reference as a service. @@ -7988,6 +7994,8 @@ effect/rpc/Utils (barrel: effect/rpc) ### `@effect/sql-d1/D1Client` +- `D1Client.D1Client` -> `@effect/sql-d1/D1Client#D1Client`: Retained; the service value is now a Context.Service, and v4 adds batch for atomic D1 batches. The D1Client interface no longer extends SqlClient.SqlClient. Yielding the service still gives D1Client & SqlClient, but an effect that requires D1Client no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies D1Client. Annotate a layer chosen between drivers as Layer.Layer\. + - `D1Client.D1ClientConfig` -> `@effect/sql-d1/D1Client#D1ClientConfig`: Retained; prepareCacheTTL now uses Duration.Input. ### `@effect/sql-drizzle/Mysql` @@ -8026,9 +8034,13 @@ effect/rpc/Utils (barrel: effect/rpc) - `Sqlite.makeWithConfig` -> `matching drizzle-orm Effect SQLite module#makeWithDefaults`: The generic constructor was removed; select the concrete backend and use makeWithDefaults(config), or make(config) with explicit services. +### `@effect/sql-libsql/LibsqlClient` + +- `LibsqlClient.LibsqlClient` -> `@effect/sql-libsql/LibsqlClient#LibsqlClient`: Retained; the service value is now a Context.Service. The LibsqlClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives LibsqlClient & SqlClient, but an effect that requires LibsqlClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies LibsqlClient. Annotate a layer chosen between drivers as Layer.Layer\. + ### `@effect/sql-mssql/MssqlClient` -- `MssqlClient.MssqlClient` -> `@effect/sql-mssql/MssqlClient#MssqlClient`: Retained; the service value is now a Context.Service rather than a GenericTag. +- `MssqlClient.MssqlClient` -> `@effect/sql-mssql/MssqlClient#MssqlClient`: Retained; the service value is now a Context.Service rather than a GenericTag. The MssqlClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives MssqlClient & SqlClient, but an effect that requires MssqlClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies MssqlClient. Annotate a layer chosen between drivers as Layer.Layer\. - `MssqlClient.MssqlClientConfig` -> `@effect/sql-mssql/MssqlClient#MssqlClientConfig`: Retained; durations use Duration.Input, parameterTypes is keyed by Statement.PrimitiveKind, and v4 adds retry and timeout options. @@ -8046,11 +8058,13 @@ effect/rpc/Utils (barrel: effect/rpc) ### `@effect/sql-mysql2/MysqlClient` +- `MysqlClient.MysqlClient` -> `@effect/sql-mysql2/MysqlClient#MysqlClient`: Retained; the service value is now a Context.Service. The MysqlClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives MysqlClient & SqlClient, but an effect that requires MysqlClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies MysqlClient. Annotate a layer chosen between drivers as Layer.Layer\. + - `MysqlClient.MysqlClientConfig` -> `@effect/sql-mysql2/MysqlClient#MysqlClientConfig`: Retained; connectionTTL uses Duration.Input and v4 adds disablePreparedStatements. ### `@effect/sql-pg/PgClient` -- `PgClient.PgClient` -> `@effect/sql-pg/PgClient#PgClient`: Retained; the service value is now a Context.Service. The listen method returns a scoped Effect acquiring a Queue.Dequeue\; consume it with Queue operations or Stream.fromQueue and read each notification's payload. Connection failures after registration fail the queue with the original SqlError; scope closure interrupts consumers. +- `PgClient.PgClient` -> `@effect/sql-pg/PgClient#PgClient`: Retained; the service value is now a Context.Service. The listen method returns a scoped Effect acquiring a Queue.Dequeue\; consume it with Queue operations or Stream.fromQueue and read each notification's payload. Connection failures after registration fail the queue with the original SqlError; scope closure interrupts consumers. The PgClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives PgClient & SqlClient, but an effect that requires PgClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies PgClient. Annotate a layer chosen between drivers as Layer.Layer\. - `PgClient.PgClientConfig` -> `@effect/sql-pg/PgClient#PgClientConfig / PgPoolConfig`: Use PgClientConfig for base settings and PgPoolConfig for make/layer; pool sizing, idle timeout, and connection TTL moved to PgPoolConfig. v3 connectTimeout also bounded waits for a free pooled connection through node-pg; v4 connectTimeout covers only opening a connection, so set acquireTimeout to fail with ConnectionError when the pool stays exhausted. The types option takes a PgTypes.Registry rather than node-pg custom types. Timestamp and timestamptz results (including array elements) are Date values with millisecond precision; infinity, -infinity, and out-of-range values become invalid Dates. Numeric readers can use getTime() or register numeric codecs. Date parameters bind as timestamptz; use PgTypes.timestamp(value) to preserve UTC fields when writing a timestamp column instead of applying the session TimeZone. @@ -8062,7 +8076,7 @@ effect/rpc/Utils (barrel: effect/rpc) ### `@effect/sql-sqlite-bun/SqliteClient` -- `SqliteClient.SqliteClient` -> `@effect/sql-sqlite-bun/SqliteClient#SqliteClient`: Retained; the service value is now a Context.Service. +- `SqliteClient.SqliteClient` -> `@effect/sql-sqlite-bun/SqliteClient#SqliteClient`: Retained; the service value is now a Context.Service. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer\. - `SqliteClient.layer` -> `SqliteClient.layer`: The layer now has a SqlError error channel for database opening and initialization failures. Handle setup failures, or use Layer.orDie when they should remain fatal. @@ -8072,11 +8086,13 @@ effect/rpc/Utils (barrel: effect/rpc) ### `@effect/sql-sqlite-do/SqliteClient` +- `SqliteClient.SqliteClient` -> `@effect/sql-sqlite-do/SqliteClient#SqliteClient`: Retained; the service value is now a Context.Service. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer\. + - `SqliteClient.SqliteClientConfig` -> `@effect/sql-sqlite-do/SqliteClient#SqliteClientConfig`: Retained; db is optional and storage may be supplied, but one of db or storage is required at runtime. ### `@effect/sql-sqlite-node/SqliteClient` -- `SqliteClient.SqliteClient` -> `@effect/sql-sqlite-node/SqliteClient#SqliteClient`: Retained on node:sqlite, but the byte-export member was removed; use backup(destination) for file backup. +- `SqliteClient.SqliteClient` -> `@effect/sql-sqlite-node/SqliteClient#SqliteClient`: Retained on node:sqlite, but the byte-export member was removed; use backup(destination) for file backup. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer\. - `SqliteClient.SqliteClientConfig` -> `@effect/sql-sqlite-node/SqliteClient#SqliteClientConfig`: Retained; prepareCacheTTL now uses Duration.Input. @@ -8088,6 +8104,8 @@ effect/rpc/Utils (barrel: effect/rpc) ### `@effect/sql-sqlite-react-native/SqliteClient` +- `SqliteClient.SqliteClient` -> `@effect/sql-sqlite-react-native/SqliteClient#SqliteClient`: Retained; the service value is now a Context.Service. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer\. + - `SqliteClient.asyncQuery` -> `@effect/sql-sqlite-react-native/SqliteClient#AsyncQuery`: Renamed and changed from FiberRef to Context.Reference; prefer withAsyncQuery or provide AsyncQuery as a service. ### `@effect/sql-sqlite-wasm/OpfsWorker` @@ -8096,7 +8114,7 @@ effect/rpc/Utils (barrel: effect/rpc) ### `@effect/sql-sqlite-wasm/SqliteClient` -- `SqliteClient.SqliteClient` -> `@effect/sql-sqlite-wasm/SqliteClient#SqliteClient`: Retained with the same export/import surface; the service value is now a Context.Service. +- `SqliteClient.SqliteClient` -> `@effect/sql-sqlite-wasm/SqliteClient#SqliteClient`: Retained with the same export/import surface; the service value is now a Context.Service. The SqliteClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives SqliteClient & SqlClient, but an effect that requires SqliteClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies SqliteClient. Annotate a layer chosen between drivers as Layer.Layer\. - `SqliteClient.currentTransferables` -> `@effect/sql-sqlite-wasm/SqliteClient#Transferables`: Renamed and changed from FiberRef to Context.Reference; prefer withTransferables or provide Transferables as a service. @@ -8132,7 +8150,7 @@ effect/rpc/Utils (barrel: effect/rpc) - `SqlClient.SafeIntegers` -> `effect/sql/SqlClient#SafeIntegers`: Moved and changed from a Reference subclass to a Context.Reference value; provide it as a service. -- `SqlClient.SqlClient` -> `effect/sql/SqlClient#SqlClient`: Moved into core Effect. Custom service implementations must expose driver and afterCommit; SqlClient.make supplies both. driver identifies the driver independently of its SQL dialect. afterCommit registers effects to run after the outermost successful commit and connection release attempt, discarding rolled-back work. withTransaction now also defers contextual Reactivity.invalidate and mutation invalidations until that commit. Transactions bypassing makeWithTransaction, such as sqlite-do transactions, run callbacks and invalidations immediately. +- `SqlClient.SqlClient` -> `effect/sql/SqlClient#SqlClient`: Moved into core Effect. Custom service implementations must expose driver and afterCommit; SqlClient.make supplies both. driver identifies the driver independently of its SQL dialect. afterCommit registers effects to run after the outermost successful commit and connection release attempt, discarding rolled-back work. withTransaction now also defers contextual Reactivity.invalidate and mutation invalidations until that commit. Transactions bypassing makeWithTransaction, such as sqlite-do transactions, run callbacks and invalidations immediately. Driver-specific client interfaces should extend SqlClient.Base rather than SqlClient, so providing a generic SqlClient does not also remove the driver requirement. - `SqlClient.SqlClient.MakeOptions` -> `effect/sql/SqlClient#SqlClient.MakeOptions`: Moved; driver is now required and conventionally names the driver package without @effect/sql-, for example pg or pglite. Rename reactiveMailbox to reactiveQueue; transactionService is optional. @@ -13985,6 +14003,18 @@ Schema.toFormatter(schema) - `STM.mergeAll` -> `Effect.reduce`: Reduce the input Effects sequentially and combine each produced value with the accumulator. +#### `STM.negate` + +**Replacement:** `Effect.map` + +STM values are now ordinary Effects and there is no negate combinator; map the boolean with Boolean.not. Run the complete transaction with Effect.tx. + +**Example** + +```ts +Effect.map(self, Boolean.not) +``` + - `STM.none` -> `Effect.matchEffect + Option.match`: Recreate the Option success/error shuffle explicitly; no dedicated helper remains. - `STM.option` -> `Effect.option`: The combinator keeps its name, but STM values are now ordinary Effects. Run the complete transaction with Effect.tx. V4 Tx operations return ordinary Effects; compose multiple operations under one outer Effect.tx to keep them atomic.