Skip to content

fix(deps): update dependency drizzle-orm to v0.44.4 #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 10, 2025

This PR contains the following updates:

Package Change Age Confidence
drizzle-orm (source) 0.38.3 -> 0.44.4 age confidence

Release Notes

drizzle-team/drizzle-orm (drizzle-orm)

v0.44.4

Compare Source

v0.44.3

Compare Source

  • Fixed types of $client for clients created by drizzle function
await db.$client.[...]
  • Added the updated_at column to the neon_auth.users_sync table definition.

v0.44.2

Compare Source

  • [BUG]: Fixed type issues with joins with certain variations of tsconfig: #​4535, #​4457

v0.44.1

Compare Source

v0.44.0

Compare Source

Error handling

Starting from this version, we’ve introduced a new DrizzleQueryError that wraps all errors from database drivers and provides a set of useful information:

  1. A proper stack trace to identify which exact Drizzle query failed
  2. The generated SQL string and its parameters
  3. The original stack trace from the driver that caused the DrizzleQueryError

Drizzle cache module

Drizzle sends every query straight to your database by default. There are no hidden actions, no automatic caching or invalidation - you’ll always see exactly what runs. If you want caching, you must opt in.

By default, Drizzle uses a explicit caching strategy (i.e. global: false), so nothing is ever cached unless you ask. This prevents surprises or hidden performance traps in your application. Alternatively, you can flip on all caching (global: true) so that every select will look in cache first.

Out first native integration was built together with Upstash team and let you natively use upstash as a cache for your drizzle queries

import { upstashCache } from "drizzle-orm/cache/upstash";
import { drizzle } from "drizzle-orm/...";

const db = drizzle(process.env.DB_URL!, {
  cache: upstashCache({
    // 👇 Redis credentials (optional — can also be pulled from env vars)
    url: '<UPSTASH_URL>',
    token: '<UPSTASH_TOKEN>',
    // 👇 Enable caching for all queries by default (optional)
    global: true,
    // 👇 Default cache behavior (optional)
    config: { ex: 60 }
  })
});

You can also implement your own cache, as Drizzle exposes all the necessary APIs, such as get, put, mutate, etc.
You can find full implementation details on the website

import Keyv from "keyv";
export class TestGlobalCache extends Cache {
  private globalTtl: number = 1000;
  // This object will be used to store which query keys were used
  // for a specific table, so we can later use it for invalidation.
  private usedTablesPerKey: Record<string, string[]> = {};
  constructor(private kv: Keyv = new Keyv()) {
    super();
  }
  // For the strategy, we have two options:
  // - 'explicit': The cache is used only when .$withCache() is added to a query.
  // - 'all': All queries are cached globally.
  // The default behavior is 'explicit'.
  override strategy(): "explicit" | "all" {
    return "all";
  }
  // This function accepts query and parameters that cached into key param,
  // allowing you to retrieve response values for this query from the cache.
  override async get(key: string): Promise<any[] | undefined> {
    ...
  }
  // This function accepts several options to define how cached data will be stored:
  // - 'key': A hashed query and parameters.
  // - 'response': An array of values returned by Drizzle from the database.
  // - 'tables': An array of tables involved in the select queries. This information is needed for cache invalidation.
  //
  // For example, if a query uses the "users" and "posts" tables, you can store this information. Later, when the app executes
  // any mutation statements on these tables, you can remove the corresponding key from the cache.
  // If you're okay with eventual consistency for your queries, you can skip this option.
  override async put(
    key: string,
    response: any,
    tables: string[],
    config?: CacheConfig,
  ): Promise<void> {
    ...
  }
  // This function is called when insert, update, or delete statements are executed.
  // You can either skip this step or invalidate queries that used the affected tables.
  //
  // The function receives an object with two keys:
  // - 'tags': Used for queries labeled with a specific tag, allowing you to invalidate by that tag.
  // - 'tables': The actual tables affected by the insert, update, or delete statements,
  //   helping you track which tables have changed since the last cache update.
  override async onMutate(params: {
    tags: string | string[];
    tables: string | string[] | Table<any> | Table<any>[];
  }): Promise<void> {
    ...
  }
}

For more usage example you can check our docs

v0.43.1

Compare Source

Fixes

v0.43.0

Compare Source

Features

  • Added cross join (#​1414)
  • Added lateral left, inner, cross joins to PostgreSQL, MySQL, Gel, SingleStore
  • Added drizzle connection attributes to SingleStore's driver instances

Fixes

  • Removed unsupported by dialect full join from MySQL select api
  • Forced Gel columns to always have explicit schema & table prefixes due to potential errors caused by lack of such prefix in subquery's selection when there's already a column bearing same name in context
  • Added missing export for PgTextBuilderInitial type
  • Removed outdated IfNotImported type check from SingleStore driver initializer
  • Fixed incorrect type inferrence for insert and update models with non-strict tsconfigs (#​2654)
  • Fixed invalid spelling of nowait flag (#​3554)
  • Add join lateral support
  • Remove .fullJoin() from MySQL API

v0.42.0

Compare Source

Features
Duplicate imports removal

When importing from drizzle-orm using custom loaders, you may encounter issues such as: SyntaxError: The requested module 'drizzle-orm' does not provide an export named 'eq'

This issue arose because there were duplicated exports in drizzle-orm. To address this, we added a set of tests that checks every file in drizzle-orm to ensure all exports are valid. These tests will fail if any new duplicated exports appear.

In this release, we’ve removed all duplicated exports, so you should no longer encounter this issue.

pgEnum and mysqlEnum now can accept both strings and TS enums

If you provide a TypeScript enum, all your types will be inferred as that enum - so you can insert and retrieve enum values directly. If you provide a string union, it will work as before.

enum Test {
  a = 'a',
  b = 'b',
  c = 'c',
}

const tableWithTsEnums = mysqlTable('enums_test_case', {
  id: serial().primaryKey(),
  enum1: mysqlEnum(Test).notNull(),
  enum2: mysqlEnum(Test).default(Test.a),
});

await db.insert(tableWithTsEnums).values([
  { id: 1, enum1: Test.a, enum2: Test.b, enum3: Test.c },
  { id: 2, enum1: Test.a, enum3: Test.c },
  { id: 3, enum1: Test.a },
]);

const res = await db.select().from(tableWithTsEnums);

expect(res).toEqual([
  { id: 1, enum1: 'a', enum2: 'b', enum3: 'c' },
  { id: 2, enum1: 'a', enum2: 'a', enum3: 'c' },
  { id: 3, enum1: 'a', enum2: 'a', enum3: 'b' },
]);
Improvements
  • Make inArray accept ReadonlyArray as a value - thanks @​Zamiell
  • Pass row type parameter to @planetscale/database's execute - thanks @​ayrton
  • New InferEnum type - thanks @​totigm
Issues closed

v0.41.0

Compare Source

  • bigint, number modes for SQLite, MySQL, PostgreSQL, SingleStore decimal & numeric column types
  • Changed behavior of sql-js query preparation to query prebuild instead of db-side prepare due to need to manually free prepared queries, removed .free() method
  • Fixed MySQL, SingleStore varchar allowing not specifying length in config
  • Fixed MySQL, SingleStore binary, varbinary data\type mismatches
  • Fixed numeric\decimal data\type mismatches: #​1290, #​1453
  • Fixed drizzle-studio + AWS Data Api connection issue: #​3224
  • Fixed isConfig utility function checking types of wrong fields
  • Enabled supportBigNumbers in auto-created mysql2 driver instances
  • Fixed custom schema tables querying in RQBv1: #​4060
  • Removed in-driver mapping for postgres types 1231 (numeric[]), 1115 (timestamp[]), 1185 (timestamp_with_timezone[]), 1187 (interval[]), 1182 (date[]), preventing precision loss and data\type mismatches
  • Fixed SQLite buffer-mode blob sometimes returning number[]

v0.40.1

Compare Source

Updates to neon-http for @neondatabase/[email protected] - thanks @​jawj

Starting from this version, drizzle-orm will be compatible with both @neondatabase/serverless <1.0 and >1.0

v0.40.0

Compare Source

New Features

Added Gel dialect support and gel-js client support

Drizzle is getting a new Gel dialect with its own types and Gel-specific logic. In this first iteration, almost all query-building features have been copied from the PostgreSQL dialect since Gel is fully PostgreSQL-compatible. The only change in this iteration is the data types. The Gel dialect has a different set of available data types, and all mappings for these types have been designed to avoid any extra conversions on Drizzle's side. This means you will insert and select exactly the same data as supported by the Gel protocol.

Drizzle + Gel integration will work only through drizzle-kit pull. Drizzle won't support generate, migrate, or push features in this case. Instead, drizzle-kit is used solely to pull the Drizzle schema from the Gel database, which can then be used in your drizzle-orm queries.

The Gel + Drizzle workflow:

  1. Use the gel CLI to manage your schema.
  2. Use the gel CLI to generate and apply migrations to the database.
  3. Use drizzle-kit to pull the Gel database schema into a Drizzle schema.
  4. Use drizzle-orm with gel-js to query the Gel database.

Here is a small example of how to connect to Gel using Drizzle:

// Make sure to install the 'gel' package 
import { drizzle } from "drizzle-orm/gel";
import { createClient } from "gel";

const gelClient = createClient();
const db = drizzle({ client: gelClient });

const result = await db.execute('select 1');

and drizzle-gel schema definition

import { gelTable, uniqueIndex, uuid, smallint, text } from "drizzle-orm/gel-core"
import { sql } from "drizzle-orm"

export const users = gelTable("users", {
    id: uuid().default(sql`uuid_generate_v4()`).primaryKey(),
    age: smallint(),
    email: text().notNull(),
    name: text(),
});

On the drizzle-kit side you can now use dialect: "gel"

// drizzle.config.ts
import { defineConfig } from 'drizzle-kit';

export default defineConfig({
  dialect: 'gel',
});

For a complete Get Started tutorial you can use our new guides:

v0.39.3

Compare Source

  • Remove react from peerDependencies

v0.39.2

Compare Source

  • To be compatible with latest Neon Auth feature we renamed the pre-defined schema internally, from neon_identity to neon_auth - thanks @​pffigueiredo

v0.39.1

Compare Source

  • Fixed SQLite onConflict clauses being overwritten instead of stacked - #​2276
  • Added view support to aliasedTable()
  • Fixed sql builder prefixing aliased views and tables with their schema

v0.39.0

Compare Source

New features

Bun SQL driver support

You can now use the new Bun SQL driver released in Bun v1.2.0 with Drizzle

In version 1.2.0, Bun has issues with executing concurrent statements, which may lead to errors if you try to run several queries simultaneously.
We've created a github issue that you can track. Once it's fixed, you should no longer encounter any such errors on Bun's SQL side

import { drizzle } from 'drizzle-orm/bun-sql';

const db = drizzle(process.env.PG_DB_URL!);

const result = await db.select().from(...);

or you can use Bun SQL instance

import { drizzle } from 'drizzle-orm/bun-sql';
import { SQL } from 'bun';

const client = new SQL(process.env.PG_DB_URL!);
const db = drizzle({ client });

const result = await db.select().from(...);

Current Limitations:

  • json and jsonb inserts and selects currently perform an additional JSON.stringify on the Bun SQL side. Once this is removed, they should work properly. You can always use custom types and redefine the mappers to and from the database.
  • datetime, date, and timestamp will not work properly when using mode: string in Drizzle. This is due to Bun's API limitations, which prevent custom parsers for queries. As a result, Drizzle cannot control the response sent from Bun SQL to Drizzle. Once this feature is added to Bun SQL, it should work as expected.
  • array types currently have issues in Bun SQL.

You can check more in Bun docs

You can check more getting started examples in Drizzle docs

WITH now supports INSERT, UPDATE, DELETE and raw sql template

with and insert

const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name').notNull(),
});

const sq = db.$with('sq').as(
    db.insert(users).values({ name: 'John' }).returning(),
);

const result = await db.with(sq).select().from(sq);

with and update

const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name').notNull(),
});

const sq = db.$with('sq').as(
    db.update(users).set({ age: 25 }).where(eq(users.name, 'John')).returning(),
);
const result = await db.with(sq).select().from(sq);

with and delete

const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name').notNull(),
});

const sq = db.$with('sq').as(
  db.delete(users).where(eq(users.name, 'John')).returning(),
);

const result = await db.with(sq).select().from(sq);

with and sql

const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name').notNull(),
});

const sq = db.$with('sq', {
  userId: users.id,
  data: {
    name: users.name,
  },
}).as(sql`select * from ${users} where ${users.name} = 'John'`);

const result = await db.with(sq).select().from(sq);

New tables in /neon import

In this release you can use neon_identity schema and users_sync table inside this schema by just importing it from /neon

// "drizzle-orm/neon"
const neonIdentitySchema = pgSchema('neon_identity');

/**
 * Table schema of the `users_sync` table used by Neon Identity.
 * This table automatically synchronizes and stores user data from external authentication providers.
 *
 * @&#8203;schema neon_identity
 * @&#8203;table users_sync
 */
export const usersSync = neonIdentitySchema.table('users_sync', {
  rawJson: jsonb('raw_json').notNull(),
  id: text().primaryKey().notNull(),
  name: text(),
  email: text(),
  createdAt: timestamp('created_at', { withTimezone: true, mode: 'string' }),
  deletedAt: timestamp('deleted_at', { withTimezone: true, mode: 'string' }),
});

Utils and small improvements

getViewName util function

import { getViewName } from 'drizzle-orm/sql'

export const user = pgTable("user", {
  id: serial(),
  name: text(),
  email: text(),
});

export const userView = pgView("user_view").as((qb) => qb.select().from(user));

const viewName = getViewName(userView)

Bug fixed and GitHub issue closed

v0.38.4

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

vercel bot commented May 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
website ✅ Ready (Inspect) Visit Preview Jul 29, 2025 11:12am

@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from 8d0f0ca to 3e44666 Compare May 28, 2025 16:41
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to v0.43.1 fix(deps): update dependency drizzle-orm to v0.44.0 May 28, 2025
@renovate renovate bot deployed to preview May 28, 2025 16:41 Active
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from 3e44666 to a5e8ee3 Compare May 30, 2025 21:37
@renovate renovate bot deployed to preview May 30, 2025 21:37 Active
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to v0.44.0 fix(deps): update dependency drizzle-orm to v0.44.1 May 30, 2025
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from a5e8ee3 to 01aaeb0 Compare June 4, 2025 10:20
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to v0.44.1 fix(deps): update dependency drizzle-orm to v0.44.2 Jun 4, 2025
@renovate renovate bot deployed to preview June 4, 2025 10:20 Active
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from 01aaeb0 to 334600d Compare July 14, 2025 19:57
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to v0.44.2 fix(deps): update dependency drizzle-orm to v0.44.3 Jul 14, 2025
@renovate renovate bot deployed to preview July 14, 2025 19:57 Active
@renovate renovate bot force-pushed the renovate/drizzle-orm-0.x branch from 334600d to 676d13d Compare July 29, 2025 11:11
@renovate renovate bot deployed to preview July 29, 2025 11:11 Active
@renovate renovate bot changed the title fix(deps): update dependency drizzle-orm to v0.44.3 fix(deps): update dependency drizzle-orm to v0.44.4 Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants