Packages

drizzle-orm

0.45.4 · 8 Oct 2026Apache-2.049.6M / weekRepositoryHomepagenpmAtom feed

Your version

0.38.0

9 Dec 2024Where it was published

0.45.4 is the newest release of 0.38.x.

In short

16 breaking6 new25 fixed8 changed

  • Breaking

    MySqlCharBuilderInitial

  • Breaking

    MySqlVarCharBuilderInitial

  • Breaking

    PgCharBuilderInitial

  • Breaking

    PgArrayBuilder

  • Breaking

    PgArray

  • Breaking

    PgVarcharBuilderInitial

  • Breaking

    PgBinaryVectorBuilderInitial

  • Breaking

    PgBinaryVectorBuilder

Security

1 advisory affects 0.38.0; 0.45.2 fixes them

Release note

Types breaking changes

A few internal types were changed and extra generic types for length of column types were added in this release. It won't affect anyone, unless you are using those internal types for some custom wrappers, logic, etc. Here is a list of all types that were changed, so if you are relying on those, please review them before upgrading

  • Breaking

    MySqlCharBuilderInitial

  • Breaking

    MySqlVarCharBuilderInitial

  • Breaking

    PgCharBuilderInitial

  • Breaking

    PgArrayBuilder

  • Breaking

    PgArray

  • Breaking

    PgVarcharBuilderInitial

  • Breaking

    PgBinaryVectorBuilderInitial

  • Breaking

    PgBinaryVectorBuilder

  • Breaking

    PgBinaryVector

  • Breaking

    PgHalfVectorBuilderInitial

  • Breaking

    PgHalfVectorBuilder

  • Breaking

    PgHalfVector

  • Breaking

    PgVectorBuilderInitial

  • Breaking

    PgVectorBuilder

  • Breaking

    PgVector

  • Breaking

    SQLiteTextBuilderInitial

New Features

  • Added new function getViewSelectedFields

  • Added $inferSelect function to views

  • Added InferSelectViewModel type for views

  • Added isView function

Validator packages updates

  • drizzle-zod has been completely rewritten. You can find detailed information about it here

  • drizzle-valibot has been completely rewritten. You can find detailed information about it here

  • drizzle-typebox has been completely rewritten. You can find detailed information about it here

  • Output for all packages are now unminified, makes exploring the compiled code easier when published to npm.

  • Smaller footprint. Previously, we imported the column types at runtime for each dialect, meaning that for example, if you're just using Postgres then you'd likely only have drizzle-orm and drizzle-orm/pg-core in the build output of your app; however, these packages imported all dialects which could lead to mysql-core and sqlite-core being bundled as well even if they're unused in your app. This is now fixed.

  • Slight performance gain. To determine the column data type we used the is function which performs a few checks to ensure the column data type matches. This was slow, as these checks would pile up every quickly when comparing all data types for many fields in a table/view. The easier and faster alternative is to simply go off of the column's columnType property.

  • Some changes had to be made at the type level in the ORM package for better compatibility with drizzle-valibot.

And a set of new features

  • createSelectSchema function now also accepts views and enums.

  • New function: createUpdateSchema, for use in updating queries.

  • New function: createSchemaFactory, to provide more advanced options and to avoid bloating the parameters of the other schema functions

Bug fixes

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.