0.41.0

drizzle-team/drizzle-orm0.41.0Mar 21, 2025by github-actions[bot]

AI Summary

This release focuses on bug fixes and improvements for drizzle-orm, primarily addressing data type mismatches across SQLite, MySQL, PostgreSQL, and SingleStore. Key changes include adding bigint/number modes for decimal types, modifying sql-js query preparation behavior, and fixing various type-related issues.

Key Highlights

  • Added `bigint` and `number` modes for decimal & numeric column types across SQLite, MySQL, PostgreSQL, and SingleStore
  • Changed sql-js query preparation behavior - now prebuilds queries instead of db-side prepare, removed `.free()` method
  • Fixed numeric/decimal data type mismatches across multiple database drivers
  • Fixed custom schema tables querying in RQBv1 (issue #4060)
  • Removed in-driver mapping for postgres array types (numeric[], timestamp[], etc.) to prevent precision loss

Breaking Changes

  • Changed sql-js query preparation behavior - queries are now prebuilt instead of db-side prepare, and the `.free()` method has been removed. Users who were manually freeing prepared queries will need to update their code.

New Features

  • `bigint` and `number` modes for `SQLite`, `MySQL`, `PostgreSQL`, `SingleStore` `decimal` & `numeric` column types
  • Enabled `supportBigNumbers` in auto-created `mysql2` driver instances

Full Release Notes

- `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](https://github.com/drizzle-team/drizzle-orm/issues/1290), [#1453](https://github.com/drizzle-team/drizzle-orm/issues/1453)  
- Fixed `drizzle-studio` + `AWS Data Api` connection issue: [#3224](https://github.com/drizzle-team/drizzle-orm/issues/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](https://github.com/drizzle-team/drizzle-orm/issues/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[]`