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

main
md 369 KB

@effect/sql-sqlite-node

4.1.2

Patch Changes

4.1.1

Patch Changes

4.1.0

Patch Changes

4.0.7

Patch Changes

4.0.6

Patch Changes

  • #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: []
    })
  })

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

  • #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. - Updated dependencies [9953c92, c6e8b20, 8d40572, 1b21e0d, 3b155e3, 895d944, 705fb68, 87912c0, 106af64, 1b21e0d, 3d59ae6, 89c9a39]: - effect@4.0.0-rc.117

4.0.0-rc.116

Patch Changes

4.0.0-rc.115

Patch Changes

4.0.0-rc.114

Patch Changes

4.0.0-rc.113

Patch Changes

4.0.0-rc.112

Patch Changes

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

  • #7162 c30386d Thanks @tim-smart! - Use a configurable five-second busy timeout and immediate transactions by default to avoid SQLite lock failures under concurrent access. Busy waits can block the event loop, while immediate transactions serialize behind other writers.
  • Updated dependencies [596f3f9, 9611ed4, 8b91605, d901928, b32bdef]:

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.3

Patch Changes

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

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.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

  • #3607 e38b3dc Thanks @thewilkybarkid! - Return raw SQL query results in sql-sqlite-node
  response = yield * sql`INSERT INTO test (name) VALUES ('hello')`.raw;
  assert.deepStrictEqual(response, { changes: 1, lastInsertRowid: 1 });

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.18

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