Change8

v1.0.0-rc.4

Breaking Changes
📦 drizzle-ormView on GitHub →
2 breaking16 features🐛 17 fixes🔧 34 symbols

Summary

This release introduces significant architectural changes, particularly splitting SQLite and MySQL into async/effect variants, and overhauling result mapping APIs. Numerous fixes address issues across PostgreSQL, SQLite, and MySQL dialects, alongside improved SQL operator typing.

⚠️ Breaking Changes

  • Removed RQBv1 from `sqlite`, removed RQBv1 `TSchema`, `TFullSchema` arguments from `sqlite` entities' generics. Users relying on RQBv1 generics for SQLite entities must update their code.
  • Removed `mapResult` method from `PreparedQuery` interface, removed `mapResult`, `mapBatchResult` from `pg` and `sqlite` raw queries. Code using these methods must be updated to use alternative result mapping strategies.

Migration Steps

  1. Update generics for SQLite entities by removing `TSchema` and `TFullSchema` arguments related to RQBv1.
  2. Replace usage of `.mapResult` or `.mapBatchResult` on `PreparedQuery`, `pg`, or `sqlite` raw queries with alternative mapping logic.

✨ New Features

  • Updated SQLite `db.$count` builder to include `.sync()` executor for sync drivers
  • Supported nested transactions in `@tursodatabase/database`, `@tursodatabase/database-wasm`
  • Added filesystem-less migrator for `@tursodatabase/database-wasm` at `drizzle-orm/tursodatbase/wasm-migrator`
  • Split SQLite into `async`, `effect` versions (`sync` remains subtype of `async`)
  • Split `mysql` into `async`, `effect` versions
  • Added codec system to `mysql`
  • Added `@tursodatabase/serverless` driver support
  • Added `@tursodatabase/sync` driver support
  • Added `@effect/sql-pglite` driver support
  • Added `@effect/sql-sqlite-node` driver support
  • Added `@effect/sql-sqlite-bun` driver support
  • Added `@effect/sql-sqlite-do` driver support
  • Added `@effect/sql-sqlite-wasm` driver support
  • Added `@effect/sql-libsql` driver support
  • Added `@effect/sql-d1` driver support
  • Added `@effect/sql-mysql2` driver support

🐛 Bug Fixes

  • Fixed broken `View` types when using `Subquery` in selection
  • Fixed custom types' JSON field API not being applied when column is used as a decoder on `SQL` fields
  • Fixed codecs not getting applied to `SQL` field when `.mapWith(column)` is set (fixes [#5724](https://github.com/drizzle-team/drizzle-orm/issues/5724))
  • Fixed `Subquery` fields' columns' codecs not being applied to subquery
  • Fixed broken in `rc.3` `db.select` in `bun-sql/pg` driver (fixes [#5779](https://github.com/drizzle-team/drizzle-orm/issues/5779))
  • Fixed instances of `sqlite` query errors not being wrapped in `DrizzleQueryError` (`db.batch()` excluded due to api incompatibility)
  • Fixed type error on `CockroachArrayBuilder` constructor caused by referencing internal field's type
  • Fixed wrong `bun-sqlite` run result type
  • Fixed missing `string` overload on `.comment(sqlCommenterComment)` in query builders
  • Fixed `sqlite` cache using same cache entry for different execute methods
  • Fixed `sql.param` passing `Placeholder` as expected input value to encoder function instead of `Placeholder`'s value type
  • Fixed unguarded `Buffer` reference in `drizzle-orm/effect-schema` that caused error in environments without `Buffer`
  • Fixed `sqlite` `blob` column runtime-type default mode mismatch (fixes [#1064](https://github.com/drizzle-team/drizzle-orm/issues/1064))
  • Fixed `generatedByDefaultAsIdentity` columns not being filtered from inserts in runtime in `postgres` dialect
  • Fixed `@effect/sql-pg` driver returning object response instead of raw response on `db.execute`
  • Fixed postgres pull from failing for non-admin roles (fixes [#5568](https://github.com/drizzle-team/drizzle-orm/issues/5568))
  • Fixed: [[BUG]: [mssql] INSERT includes generatedAlwaysAs (computed) columns in the column list — SQL Server error 271](https://github.com/drizzle-team/drizzle-orm/issues/5881)

Affected Symbols