chore(deps): update dependency drizzle-kit to v0.27.1#3
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
cd9b8c8 to
49a38a5
Compare
49a38a5 to
2bbccbe
Compare
2bbccbe to
c20c8f7
Compare
c20c8f7 to
f3f9015
Compare
f3f9015 to
e597823
Compare
e597823 to
1e95c96
Compare
1e95c96 to
4c5e303
Compare
4c5e303 to
2469f66
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.22.8->0.27.1Release Notes
drizzle-team/drizzle-orm (drizzle-kit)
v0.27.1Compare Source
v0.27.0Compare Source
Correct behavior when installed in a monorepo (multiple Drizzle instances)
Replacing all
instanceofstatements with a customis()function allowed us to handle multiple Drizzle packages interacting properly.It also fixes one of our biggest Discord tickets:
maximum call stack exceeded🎉You should now use
is()instead ofinstanceofto check if specific objects are instances of specific Drizzle types. It might be useful if you are building something on top of the Drizzle API.distinctclause supportAlso,
distinct onclause is available for PostgreSQL:bigintandbooleansupport for SQLiteContributed by @MrRahulRamkumar (#558), @raducristianpopa (#411) and @meech-ward (#725)
DX improvements
wherecallback in RQB for tables without relationsVarious docs improvements
v0.26.2Compare Source
v0.26.1Compare Source
data is malformedfor viewsv0.26.0Compare Source
New Features
Checks support in
drizzle-kitYou can use drizzle-kit to manage your
checkconstraint defined in drizzle-orm schema definitionFor example current drizzle table:
will be generated into
The same is supported in all dialects
Limitations
generatewill work as expected for all check constraint changes.pushwill detect only check renames and will recreate the constraint. All other changes to SQL won't be detected and will be ignored.So, if you want to change the constraint's SQL definition using only
push, you would need to manually comment out the constraint,push, then put it back with the new SQL definition andpushone more time.Views support in
drizzle-kitYou can use drizzle-kit to manage your
viewsdefined in drizzle-orm schema definition. It will work with all existing dialects and view optionsPostgreSQL
For example current drizzle table:
will be generated into
Views supported in all dialects, but materialized views are supported only in PostgreSQL
Limitations
generatewill work as expected for all view changespushlimitations:push, you would need to manually comment out the view,push, then put it back with the new SQL definition andpushone more time.Updates for PostgreSQL enums behavior
We've updated enum behavior in Drizzle with PostgreSQL:
Add value after or before in enum: With this change, Drizzle will now respect the order of values in the enum and allow adding new values after or before a specific one.
Support for dropping a value from an enum: In this case, Drizzle will attempt to alter all columns using the enum to text, then drop the existing enum and create a new one with the updated set of values. After that, all columns previously using the enum will be altered back to the new enum.
Support for dropping an enum
Support for moving enums between schemas
Support for renaming enums
v0.25.0Compare Source
Breaking changes and migrate guide for Turso users
If you are using Turso and libsql, you will need to upgrade your
drizzle.configand@libsql/clientpackage.@libsql/client@0.10.0or higher if you are using themigratefunction. For other use cases, you can continue using previous versions(But the suggestion is to upgrade)To install the latest version, use the command:
drizzle.configfor SQLite and Turso users, which allowed a shared strategy for both dialects. Starting with this release, we are introducing the turso dialect in drizzle-kit. We will evolve and improve Turso as a separate dialect with its own migration strategies.Before
After
If you are using only SQLite, you can use
dialect: "sqlite"LibSQL/Turso and Sqlite migration updates
SQLite "generate" and "push" statements updates
Starting from this release, we will no longer generate comments like this:
We will generate a set of statements, and you can decide if it's appropriate to create data-moving statements instead. Here is an example of the SQL file you'll receive now:
LibSQL/Turso "generate" and "push" statements updates
Since LibSQL supports more ALTER statements than SQLite, we can generate more statements without recreating your schema and moving all the data, which can be potentially dangerous for production environments.
LibSQL and Turso will now have a separate dialect in the Drizzle config file, meaning that we will evolve Turso and LibSQL independently from SQLite and will aim to support as many features as Turso/LibSQL offer.
With the updated LibSQL migration strategy, you will have the ability to:
You can find more information in the LibSQL documentation
LIMITATIONS
This is because LibSQL/Turso does not support dropping this type of foreign key.
If the table has indexes, altering columns will cause index recreation:
Drizzle-Kit will drop the indexes, modify the columns, and then create the indexes.
Adding or dropping composite foreign keys is not supported and will cause table recreation.
Primary key columns can not be altered and will cause table recreation.
Altering columns that are part of foreign key will cause table recreation.
NOTES
See more: https://www.sqlite.org/foreignkeys.html
New
casingparam indrizzle-ormanddrizzle-kitThere are more improvements you can make to your schema definition. The most common way to name your variables in a database and in TypeScript code is usually
snake_casein the database andcamelCasein the code. For this case, in Drizzle, you can now define a naming strategy in your database to help Drizzle map column keys automatically. Let's take a table from the previous example and make it work with the new casing API in DrizzleTable can now become:
As you can see,
inStockdoesn't have a database name alias, but by defining the casing configuration at the connection level, all queries will automatically map it tosnake_caseFor
drizzle-kitmigrations generation you should also specifycasingparam in drizzle config, so you can be sure you casing strategy will be applied to drizzle-kit as wellv0.24.2Compare Source
New Features
🎉 Support for
pglitedriverYou can now use pglite with all drizzle-kit commands, including Drizzle Studio!
Bug fixes
v0.24.1Compare Source
Bug fixes
What was fixed
introspectcommand.::<type>was included in the introspected output.preservecasing option was brokenTickets that were closed
v0.24.0Compare Source
mysql2(sponsored by @rizen ❤). Read more in the docs.prepare()in MySQL no longer requires a name argumentv0.23.2Compare Source
schemaFilterobject was passed. It was detecting enums even in schemas that were not defined in the schemaFilter.drizzle-kit upcommand to work as expected, starting from the sequences release.v0.23.1Compare Source
InferModelfromdrizzle-ormv0.23.0Compare Source
🎉 Added Knex and Kysely adapters! They allow you to manage the schemas and migrations with Drizzle and query the data with your favorite query builder. See documentation for more details:
🎉 Added "type maps" to all entities. You can access them via the special
_property. For example:Full documentation on the type maps is coming soon.
🎉 Added
.$type()method to all column builders to allow overriding the data type. It also replaces the optional generics on columns.❗ Changed syntax for text-based enum columns:
🎉 Allowed passing an array of values into
.insert().values()directly without spreading:The spread syntax is now deprecated and will be removed in one of the next releases.
🎉 Added "table creators" to allow for table name customization:
🎉 Implemented support for selecting/joining raw SQL expressions:
🐛 Fixed a lot of bugs from user feedback on GitHub and Discord (thank you! ❤). Fixes #293 #301 #276 #269 #253 #311 #312
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 this update again.
This PR was generated by Mend Renovate. View the repository job log.