Skip to content
verdict:

Drizzle ORM 1.0.0-rc.1

preview

note: no summary for this older release

We summarize recent releases. The original release notes for this version are below.

release-notesgithub.com/drizzle-team/drizzle-orm · 125 lines
  1. # v1.0.0-rc.1
  2. ⚠️ This release introduced a breaking change into our `casing` API([see below](#new-casing-api)) and removes RQB v1 `._query` for postgres
  3. ## JIT mappers
  4. Drizzle ORM now has an opt-in API for JIT(just in time compilated) mappers which make most expensive part of the db request pipeline(row mapping) as fast as humanly possible.
  5. ```ts
  6. const db = drizzle({ ..., jit: true })
  7. const query = db.select().from(users).prepare();
  8. // ^ here drizzle generates a jit mapper which will then be reused during each invocation
  9. server.get('users', (c) => {
  10. const users = await query.execute(); // as fast as using raw driver
  11. return c.json(users)
  12. })
  13. ```
  14. We've reworked internals of Drizzle ORM with the new system of `codecs`. Those are now in charge of normalising responses and requests for diffrent drivers across pg dialect. They helped us not only properly fix a set of data mapping issues but also massively improve performance by not doing unnecessary work.
  15. We've seen a 25%-30% reduction in latency, while +800rps(14500->15300) in our benchmarks
  16. Give it a go and let us know if everything works just fine!
  17. ## Effect v4
  18. `drizzle-orm@1.0.0-rc.1` comes with native support for Effect v4 via:
  19. ```ts
  20. import { PgClient } from '@effect/sql-pg';
  21. import * as PgDrizzle from 'drizzle-orm/effect-postgres';
  22. import * as Effect from 'effect/Effect';
  23. import * as Redacted from 'effect/Redacted';
  24. import { relations } from '../relations';
  25. const connectionStr = Redacted.make(process.env['PG_CONNECTION_STRING']!);
  26. const PgClientLive = PgClient.layer({
  27. url: connectionStr,
  28. });
  29. const DB = PgDrizzle.make({ relations }).pipe(Effect.provide(PgDrizzle.DefaultServices));
  30. const program = Effect.gen(function*() {
  31. const db = yield* DB;
  32. const users = yield* db.select().from(usersTable);
  33. }).pipe(Effect.provide(PgClientLive));
  34. await Effect.runPromise(program);
  35. ```
  36. ## New Casing API
  37. ⚠️ BREAKING CHANGE
  38. In `rc.1` we've finally reworked our legacy casing API of `const db = drizzle({..., casing: "camel" })` which turned out to not be a proper solution, it required duplication in drizzle-orm instantiation and drizzle-kit config and introduced and set of endless bugs all around query builder chain. All of the above is now fixed with new API:
  39. ```ts
  40. import * as d from "drizzle-orm/pg-core";
  41. const users = d.snakeCase.table("users", {
  42. id: d.serial().primaryKey(),
  43. email: d.text().unique(),
  44. fullName: d.text(), // full_name in db
  45. createdAt: d.timestamp().defaultNow(), // created_at in db
  46. })
  47. // --- for namespaces/schemas you can use
  48. const schema2 = d.camelCase.schema("schema2");
  49. const usersInSchema2 = schema2.table("users", ...);
  50. const ordersInSchema2 = schema2.table("orders", ...);
  51. // ^ all entities in schema2 will be snake_cased
  52. // --- all available entities
  53. import { snakeCase, camelCase } from "drizzle-orm/pg-core";
  54. snakeCase.view
  55. snakeCase.materializedView
  56. snakeCase.schema
  57. snakeCase.table
  58. camelCase.view
  59. camelCase.materializedView
  60. camelCase.schema
  61. camelCase.table
  62. ```
  63. ## New Netlify Database Driver
  64. > Note: The Netlify Database driver is developed and maintained by the Netlify team.
  65. **Installation:**
  66. ```bash
  67. npm install @netlify/database
  68. ```
  69. **Usage example:**
  70. ```typescript
  71. import { drizzle } from 'drizzle-orm/netlify-db';
  72. const db = drizzle();
  73. const result = await db.execute('select 1');
  74. ```
  75. ```typescript
  76. import { drizzle } from 'drizzle-orm/netlify-db';
  77. const db = drizzle(process.env.DATABASE_URL);
  78. const result = await db.execute('select 1');
  79. ```
  80. ```typescript
  81. import { drizzle } from 'drizzle-orm/netlify-db';
  82. // Explicit client — consumer controls the driver
  83. const db = drizzle({ client: netlifyDbClient });
  84. const result = await db.execute('select 1');
  85. ```
  86. ## Bug fixes and improvements:
  87. - Codec system for `postgres` - resolves issues created by differences of data types returned by different drivers or different contexts of query (regular select, JSON object, postgres array). Currently only handles supported by drizzle constructors column types. (fixes #3018, #5090, #5287)
  88. - Optimized query mappers for `postgres`
  89. - Opt-in JIT-generated mappers for all dialects
  90. - Optimized RQBv2 mappers for all dialects
  91. - ⚠️ BREAKING CHANGE: Removed RQBv1 (`db._query`) from `postgres`
  92. - Moved pg array utils (`makePgArray`, `parsePgArray`) from `drizzle-orm/pg-core/utils[/array]` to `drizzle-orm/pg-core/array`
  93. - Simplified `postgres` sessions & prepared queries
  94. - Fixed `neon-http` `bytea` data corruption
  95. - Fixed `bun-sql/postgres` timestamp timezone truncation, `json[b]` data double stringification
  96. - ⚠️ BREAKING CHANGE: Reworked casing API - moved casing control from `db` instance to `table` \ `view` \ `schema` via `import { snakeCase, camelCase } from "drizzle-orm/dialect-core"`, fixed #5112 #5282 #4181 #4209
  97. - Switched from Effect V3 to Effect V4 beta for `effect-schema`, `effect-postgres` (fixes #5414)

view on githubimported 2026-09-28 via npm