Skip to content

0.38.0

Compare
Choose a tag to compare
@github-actions github-actions released this 09 Dec 15:06
· 114 commits to main since this release
c18f224

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

  • MySqlCharBuilderInitial
  • MySqlVarCharBuilderInitial
  • PgCharBuilderInitial
  • PgArrayBuilder
  • PgArray
  • PgVarcharBuilderInitial
  • PgBinaryVectorBuilderInitial
  • PgBinaryVectorBuilder
  • PgBinaryVector
  • PgHalfVectorBuilderInitial
  • PgHalfVectorBuilder
  • PgHalfVector
  • PgVectorBuilderInitial
  • PgVectorBuilder
  • PgVector
  • 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

Thanks to @L-Mario564 for making more updates than we expected to be shipped in this release. We'll copy his message from a PR regarding improvements made in this release:

  • 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