v1.0.0-beta.13
Breaking Changes📦 drizzle-ormView on GitHub →
⚠ 2 breaking✨ 3 features🐛 2 fixes🔧 12 symbols
Summary
Drizzle Kit now supports top-level await in configuration and schema files, resolving module import errors. The Effect Postgres integration received major API updates to better align with Effect patterns, including configurable logging and caching layers.
⚠️ Breaking Changes
- The API for using Drizzle with Effect Postgres has been significantly updated to align better with Effect's style. Previously, users manually configured `PgClient.layer` and instantiated `drizzle(client, { logger: true, ... })`. Now, users should use `PgDrizzle.makeWithDefaults()` or `PgDrizzle.make({...})` and provide services like `PgClient.layer` and logging/caching layers separately.
- When using Effect Postgres, the default logger is now a no-op logger. To enable logging, you must explicitly provide `EffectLogger.layer` or a wrapped Drizzle logger via `Effect.provide`.
Migration Steps
- If using Drizzle Kit, replace `require()` calls in configuration/schema files with ES module syntax if you intend to use top-level await.
- When using `drizzle-orm/effect-postgres`, update initialization logic: replace manual `drizzle(client, ...)` instantiation with `PgDrizzle.makeWithDefaults()` or `PgDrizzle.make({...})`.
- If you relied on logging being enabled by default in Effect Postgres, you must now explicitly provide logging using `Effect.provide(EffectLogger.layer)` or similar.
- If using Effect Postgres, review the provided examples for correctly composing `PgClient.layer` and providing `PgDrizzle.DefaultServices`.
✨ New Features
- Enabled top-level await support in `drizzle-kit.config` and schema files on Node.js by switching from `require()` to `async loadModule()` using `jiti`.
- Introduced native Effect Logger integration for `drizzle-orm/effect-postgres`, allowing queries to be logged using `Effect.log` via `EffectLogger.layer`.
- Added support for providing custom Effect Cache implementations via `EffectCache.layerFromDrizzle(customCache)`.
🐛 Bug Fixes
- Fixed an issue where Top-level await was not supported in `drizzle-kit.config.ts` and schema files.
- Fixed `SyntaxError: Cannot use import statement outside a module` error when using `drizzle-kit`.