drizzle-orm
0.45.4 · 8 Oct 2026Apache-2.049.6M / weekRepositoryHomepagenpmAtom feed
0.45.4 is the newest release of 0.42.x.
In short
3 new3 changed
Security
1 advisory affects 0.42.0; 0.45.2 fixes them
- HighDrizzle ORM has SQL injection via improperly escaped SQL identifiersGHSA-gpj5-g38j-94v9 · 8 Apr 2026Fixed in 0.45.2
Release note
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
inArrayacceptReadonlyArrayas a valuePass row type parameter to
@planetscale/database's executeNew
InferEnumtype
Issues closed
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.