Files
effect/packages/sql/CHANGELOG.md
T
effect-botandgithub-actions[bot] 5e8c4fe9e8 Version Packages (v3) (#9296)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-23 09:20:26 +13:00

159 KiB

@effect/sql

0.52.2

Patch Changes

0.52.1

Patch Changes

0.52.0

Patch Changes

0.51.1

Patch Changes

0.51.0

Patch Changes

0.50.0

Patch Changes

0.49.0

Patch Changes

0.48.6

Patch Changes

0.48.5

Patch Changes

  • #5824 019bf24 Thanks @tim-smart! - improve ordering guarantees for SqlPersistedQueue

0.48.4

Patch Changes

0.48.3

Patch Changes

0.48.2

Patch Changes

0.48.1

Patch Changes

0.48.0

Minor Changes

  • #5686 571025c Thanks @tim-smart! - allow any type to be used as sql parameters

Patch Changes

0.47.0

Patch Changes

0.46.0

Patch Changes

0.45.0

Patch Changes

0.44.2

Patch Changes

0.44.1

Patch Changes

  • #5350 d0b5fd1 Thanks @tim-smart! - add Migrator.fromRecord api

0.44.0

Patch Changes

0.43.0

Patch Changes

0.42.1

Patch Changes

  • #5238 9dc9269 Thanks @ilovedesert001! - Add error cause to the migration phase failure

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

Patch Changes

0.40.14

Patch Changes

0.40.13

Patch Changes

0.40.12

Patch Changes

0.40.11

Patch Changes

0.40.10

Patch Changes

0.40.9

Patch Changes

0.40.8

Patch Changes

0.40.7

Patch Changes

0.40.6

Patch Changes

0.40.5

Patch Changes

0.40.4

Patch Changes

0.40.3

Patch Changes

0.40.2

Patch Changes

0.40.1

Patch Changes

0.40.0

Patch Changes

0.39.0

Patch Changes

0.38.2

Patch Changes

0.38.1

Patch Changes

0.38.0

Patch Changes

0.37.12

Patch Changes

0.37.11

Patch Changes

0.37.10

Patch Changes

0.37.9

Patch Changes

0.37.8

Patch Changes

0.37.7

Patch Changes

0.37.6

Patch Changes

0.37.5

Patch Changes

0.37.4

Patch Changes

0.37.3

Patch Changes

0.37.2

Patch Changes

0.37.1

Patch Changes

0.37.0

Patch Changes

0.36.0

Patch Changes

0.35.8

Patch Changes

0.35.7

Patch Changes

0.35.6

Patch Changes

0.35.5

Patch Changes

0.35.4

Patch Changes

0.35.3

Patch Changes

0.35.2

Patch Changes

0.35.1

Patch Changes

0.35.0

Patch Changes

0.34.1

Patch Changes

0.34.0

Patch Changes

0.33.21

Patch Changes

0.33.20

Patch Changes

0.33.19

Patch Changes

0.33.18

Patch Changes

0.33.17

Patch Changes

0.33.16

Patch Changes

0.33.15

Patch Changes

0.33.14

Patch Changes

0.33.13

Patch Changes

0.33.12

Patch Changes

0.33.11

Patch Changes

0.33.10

Patch Changes

0.33.9

Patch Changes

0.33.8

Patch Changes

0.33.7

Patch Changes

0.33.6

Patch Changes

0.33.5

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

Minor Changes

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

Patch Changes

0.32.4

Patch Changes

0.32.3

Patch Changes

0.32.2

Patch Changes

0.32.1

Patch Changes

0.32.0

Patch Changes

0.31.1

Patch Changes

0.31.0

Patch Changes

0.30.7

Patch Changes

0.30.6

Patch Changes

0.30.5

Patch Changes

0.30.4

Patch Changes

0.30.3

Patch Changes

0.30.2

Patch Changes

0.30.1

Patch Changes

0.30.0

Patch Changes

0.29.1

Patch Changes

0.29.0

Patch Changes

0.28.4

Patch Changes

0.28.3

Patch Changes

0.28.2

Patch Changes

0.28.1

Patch Changes

0.28.0

Patch Changes

0.27.0

Patch Changes

0.26.1

Patch Changes

0.26.0

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

Patch Changes

0.23.2

Patch Changes

0.23.1

Patch Changes

0.23.0

Patch Changes

0.22.7

Patch Changes

0.22.6

Patch Changes

0.22.5

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

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

Minor Changes

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

Patch Changes

0.20.12

Patch Changes

0.20.11

Patch Changes

0.20.10

Patch Changes

0.20.9

Patch Changes

0.20.8

Patch Changes

0.20.7

Patch Changes

0.20.6

Patch Changes

0.20.5

Patch Changes

0.20.4

Patch Changes

0.20.3

Patch Changes

0.20.2

Patch Changes

0.20.1

Patch Changes

0.20.0

Patch Changes

0.19.0

Patch Changes

0.18.16

Patch Changes

0.18.15

Patch Changes

0.18.14

Patch Changes

0.18.13

Patch Changes

0.18.12

Patch Changes

0.18.11

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

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

Minor Changes

  • #3683 f100e20 Thanks @tim-smart! - use decoded ids in sql resolvers

0.13.4

Patch Changes

0.13.3

Patch Changes

  • #3676 0a68746 Thanks @tomglaize! - Add VariantSchema fieldFromKey utility to rename the encoded side of a field by variant.

    Example usage:

    import { Schema } from "@effect/schema"
    import { VariantSchema } from "@effect/experimental"
    
    const { Class, fieldFromKey } = VariantSchema.make({
      variants: ["domain", "json"],
      defaultVariant: "domain"
    })
    
    class User extends Class<User>("User")({
      id: Schema.Int,
      firstName: Schema.String.pipe(fieldFromKey({ json: "first_name" }))
    }) {}
    
    console.log(
      Schema.encodeSync(User.json)({
        id: 1,
        firstName: "Bob"
      })
    )
    /*
    { id: 1, first_name: 'Bob' }
    */
    
  • Updated dependencies [0a68746, 734eae6, fd83d0e, 4509656, ad7e1de, 090e41c, 090e41c]:

0.13.2

Patch Changes

0.13.1

Patch Changes

  • #3657 d5c8e7e Thanks @jamiehodge! - fix Model findById data loader

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

  • #3600 ccd67df Thanks @tim-smart! - remove network roundtrip from mysql update in Model repository

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

  • #3455 e9da539 Thanks @tim-smart! - add Model module to /sql

    The Model module can be used to create domain schemas with common variants for the database and serializing to JSON.

    import { Schema } from "@effect/schema"
    import { Model } from "@effect/sql"
    
    export const GroupId = Schema.Number.pipe(Schema.brand("GroupId"))
    
    export class Group extends Model.Class<Group>("Group")({
      id: Model.Generated(GroupId),
      name: Schema.NonEmptyTrimmedString,
      createdAt: Model.DateTimeInsertFromDate,
      updatedAt: Model.DateTimeUpdateFromDate
    }) {}
    
    // schema used for selects
    Group
    
    // schema used for inserts
    Group.insert
    
    // schema used for updates
    Group.update
    
    // schema used for json api
    Group.json
    Group.jsonCreate
    Group.jsonUpdate
    
    // you can also turn them into classes
    class GroupJson extends Schema.Class<GroupJson>("GroupJson")(Group.json) {
      get upperName() {
        return this.name.toUpperCase()
      }
    }
    
  • #3460 4fabf75 Thanks @tim-smart! - support partial objects in sql helpers

  • Updated dependencies [e9da539]:

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 SqlClient from "@effect/sql/SqlClient"
    import * as MysqlClient from "@effect/sql/MysqlClient"
    
    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

Minor Changes

  • #3387 42d0706 Thanks @tim-smart! - allow sql Statement transformers to be effectful

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

  • #2867 3e86ced Thanks @jamiehodge! - fix sql mysql migrator

0.3.1

Patch Changes

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

  • #2693 0724274 Thanks @tim-smart! - make @effect/sql dialect agnostic

    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 * as Sql from "@effect/sql"
    import { Effect } from "effect"
    
    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 * as Sql from "@effect/sql"
    import { Effect } from "effect"
    
    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