Change8

v1.0.0-beta.2

Breaking Changes
📦 drizzle-orm
4 breaking9 features🐛 9 fixes2 deprecations🔧 11 symbols

Summary

This release introduces MSSQL and CockroachDB support, a complete rewrite of drizzle-kit with a new v3 migration folder structure, and the transition to Relational Query Builder (RQB) v2.

⚠️ Breaking Changes

  • Migrations folder structure (v3) has been updated: journal.json is removed and SQL files/snapshots are now grouped into separate folders. Use 'drizzle-kit up' to migrate.
  • The 'drizzle-kit drop' command has been removed.
  • schemaFilter behavior update: drizzle-kit now manages all schemas defined in code by default. Use schemaFilter (now supporting glob patterns) to restrict this.
  • Relational Query Builder (RQB) has been upgraded to v2, requiring manual migration of schema and query logic.

Migration Steps

  1. Run 'drizzle-kit up' to upgrade migration folders to the v3 format.
  2. Follow the RQBv1 to RQBv2 migration guide at https://orm.drizzle.team/docs/relations-v1-v2.
  3. Update RLS definitions from .enableRLS() to pgTable.withRLS().
  4. If using MSSQL or CockroachDB, install the 'mssql' or 'pg' packages respectively.

✨ New Features

  • Full support for MSSQL dialect in drizzle-orm, drizzle-kit, and drizzle-seed (excluding RQBv2).
  • Full support for CockroachDB dialect in drizzle-orm, drizzle-kit, and drizzle-seed (excluding RQBv2).
  • Introduced 'defineRelationsPart' helper to allow splitting relations configurations into multiple parts.
  • Complete drizzle-kit architecture rewrite: migrated to DDL snapshots, improved diff detection, and reduced introspection time to <1s.
  • Added 'drizzle-kit pull --init' flag to initialize migration tracking on an existing database.
  • Added '.as()' alias support directly on column objects (e.g., users.id.as('userId')).
  • Added new MySQL column types: blob, tinyblob, mediumblob, and longblob.
  • Added query hints and 'explain' support for 'drizzle-kit push'.
  • schemaFilter now supports glob patterns.

🐛 Bug Fixes

  • Fixed pg-native Pool detection in node-postgres transactions.
  • Allowed subqueries in select fields.
  • Fixed $onUpdate not handling SQL values.
  • Fixed pg mappers not handling Date instances in bun-sql:postgresql driver.
  • Fixed findFirst failing with TypeError when no results are found.
  • Fixed jsonb default boolean literals generating 'truen' instead of 'true'.
  • Fixed MSSQL invalid migration generation for ALTER COLUMN on PK and FK Drop on Rename.
  • Fixed drizzle-kit not considering prefix when generating migrations.
  • Fixed invalid autosummarize in drizzle-kit pull.

🔧 Affected Symbols

defineRelationsPartdefineRelationspgTable.withRLSColumn.asdrizzle-orm/node-mssqldrizzle-orm/cockroachschemaFilterblobtinyblobmediumbloblongblob

⚡ Deprecations

  • pgTable().enableRLS() is deprecated. Use pgTable.withRLS('name', {}) instead.
  • @esbuild-kit/esm-loader (deprecated/insecure) has been replaced/addressed.