Update dependency drizzle-kit to ^0.23.0 #21
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.19.13->^0.23.0Release Notes
drizzle-team/drizzle-kit-mirror (drizzle-kit)
v0.23.0Compare Source
v0.22.8: 0.22.8Compare Source
v0.22.7Compare Source
v0.22.6: 0.22.6Compare Source
drizzle-kit upof snapshots from v6 to v7v0.22.5: 0.22.5Compare Source
v0.22.4: 0.22.4Compare Source
data losstriggers onpushwhen adding aNOT NULLconstraint to a column and when removing thedefaultvalue from a column. These actions will now be performed immediately, and if there are anyNULLvalues in the column, you will receive an error from the databasev0.22.3: 0.22.3Compare Source
Cannot use 'in' operator to search for 'default' in undefinederror on push and generatev0.22.2: 0.22.2Compare Source
,. This should fix problems fortsvectorindexes, such as:v0.22.1: 0.22.1Compare Source
Bug fixes
Improvements
🎉 Drizzle Studio now supports raw responses from D1 HTTP. This means that Drizzle Studio now has full support for D1, and all queries should work as expected!
🎉 Refactor the d1-http driver to properly show the table row count
v0.22.0: 0.22.0Compare Source
New Features
🎉 Full support for indexes in PostgreSQL
The previous Drizzle+PostgreSQL indexes API was incorrect and was not aligned with the PostgreSQL documentation. The good thing is that it was not used in queries, and drizzle-kit didn't support all properties for indexes. This means we can now change the API to the correct one and provide full support for it in drizzle-kit
Previous API
.on..usingand.onin our case are the same thing, so the API is incorrect here..asc(),.desc(),.nullsFirst(), and.nullsLast()should be specified for each column or expression on indexes, but not on an index itself.Current API
🎉 Support for new types
Drizzle Kit can now handle:
pointandlinefrom PostgreSQLvectorfrom the PostgreSQLpg_vectorextensiongeometryfrom the PostgreSQLPostGISextension🎉 New param in drizzle.config -
extensionsFiltersThe PostGIS extension creates a few internal tables in the
publicschema. This means that if you have a database with the PostGIS extension and usepushorintrospect, all those tables will be included indiffoperations. In this case, you would need to specifytablesFilter, find all tables created by the extension, and list them in this parameter.We have addressed this issue so that you won't need to take all these steps. Simply specify
extensionsFilterswith the name of the extension used, and Drizzle will skip all the necessary tables.Currently, we only support the
postgisoption, but we plan to add more extensions if they create tables in thepublicschema.The
postgisoption will skip thegeography_columns,geometry_columns, andspatial_ref_systablesImprovements
👍 Update zod schemas for database credentials and write tests to all the positive/negative cases
👍 Support full set of SSL params in kit config, provide types from node:tls connection
👍 Normilized SQLite urls for
libsqlandbetter-sqlite3driversThose drivers have different file path patterns, and Drizzle Kit will accept both and create a proper file path format for each
👍 Updated MySQL and SQLite index-as-expression behavior
In this release MySQL and SQLite will properly map expressions into SQL query. Expressions won't be escaped in string but columns will be
Bug Fixes
How
pushandgenerateworks for indexesLimitations
You should specify a name for your index manually if you have an index on at least one expression
Example
Push won't generate statements if these fields(list below) were changed in an existing index:
.on()and.using().where()statements.op()on columnsIf you are using
pushworkflows and want to change these fields in the index, you would need to:For the
generatecommand,drizzle-kitwill be triggered by any changes in the index for any property in the new drizzle indexes API, so there are no limitations here.v0.21.4Compare Source
bug fixes
node-pgpool connection halting, regression introduced in previous release while migrating fromclienttopoolwith max 1 connectionv0.21.3Compare Source
Cloudflare D1 HTTP API support 🎉
Drizzle Chrome Extension now has support for Cloudflare D1!
Drizzle Kit now lets you run
migrate,push,introspectandstudiocommands using Cloudflare D1 HTTP API, you just need to update connection params indrizzle.config.ts:You can find
accountId,databaseIdandtokenin Cloudflare dashboardTo get
accountIdgo to Workers & Pages -> Overview -> copy Account ID from the right sidebarTo get
databaseIdopen D1 database you want to connect to and copy Database IDTo get
tokengo to My profile -> API Tokens and create token with D1 edit permissionsBug fixes
checkcommand #2284postgresdialect #2346v0.21.2Compare Source
Bug fixes
A list of regressions after
0.21.0that were fixed (there are more, and those should be fixed in the next patch releases):generateandpushwere not detecting new columns added.pushTickets that were closed
v0.21.1Compare Source
Drizzle Studio support for per-database preferences
When connecting to different databases with Drizzle Local Studio, we will store all preferences such as selected tabs, hidden columns, pagination, etc., separately for each database
Drizzle Studio support for advanced bug report context
Now you can assist us in debugging Drizzle Studio errors. No more need to say, "Please share your schema with us"; just click a button, download the bug report, and send it to us!
v0.21.0Compare Source
Breaking changes
❗ Snapshots Upgrade
All PostgreSQL and SQLite-generated snapshots will be upgraded to version 6. You will be prompted to upgrade them by running
drizzle-kit up❗ Removing :dialect from
drizzle-kitcli commandsYou can now just use commands, like:
drizzle-kit generatedrizzle-kit pushwithout specifying dialect. This param is moved to
drizzle.config.ts❗
drizzle.configupdatedialectis now mandatory; specify which database dialect you are connecting to. Options includemysql,postgresql, orsqlite.driverhas become optional and will have a specific driver, each with a different configuration ofdbCredentials. Available drivers are:aws-data-apitursod1-http- currently WIPexpourl- a unified parameter for the previously existingconnectionStringanduri.migrations- a new object parameter to specify a custom table and schema for the migrate command:table- the custom table where drizzle will store migrations.schema- the custom schema where drizzle will store migrations (Postgres only).Usage examples for all new and updated commands
Drizzle driver selection follows the current strategy:
If a
driveris specified, use this driver for querying.If no driver is specified:
For
postgresqldialect, Drizzle will:pgdriver is installed and use it.postgresdriver and use it.@vercel/postgres.@neondatabase/serverless.For
mysqldialect, Drizzle will:mysql2driver is installed and use it.@planetscale/databaseand use it.For
sqlitedialect, Drizzle will:@libsql/clientdriver is installed and use it.better-sqlite3and use it.❗ MySQL schemas/database are no longer supported by drizzle-kit
Drizzle Kit won't handle any schema changes for additional schemas/databases in your drizzle schema file
New Features
🎉 Pull relations
Drizzle will now pull
relationsfrom the database by extracting foreign key information and translating it into arelationsobject. You can view therelations.tsfile in theoutfolder after introspection is completeFor more info about relations, please check the docs
🎉 Custom name for generated migrations
To specify a name for your migration you should use
--name <name>Usage
🎉 New command
migrateYou can now apply generated migrations to your database directly from
drizzle-kitUsage
By default, drizzle-kit will store migration data entries in the
__drizzle_migrationstable and, in the case of PostgreSQL, in adrizzleschema. If you want to change this, you will need to specify the modifications indrizzle.config.ts.How to migrate from
0.20.18to0.21.01. Remove all
:dialectprefixes from your Drizzle-Kit commands.Example: Change
drizzle-kit push:mysqltodrizzle-kit push.2. Update your
drizzle.config.tsfile:dialecttodrizzle.config.ts. It is now mandatory and can be 'postgresql', 'mysql', or 'sqlite'.drivertodrizzle.config.tsONLY if you are usingaws-data-api,turso,d1-http(WIP), orexpo. Otherwise, you can remove thedriverfromdrizzle.config.ts.connectionStringoruriindbCredentials, you should now useurl.3. If you are using PostgreSQL and had migrations generated in your project, please run
drizzle-kit upso Drizzle can upgrade all the snapshots to version 6.v0.20.18Compare Source
v0.20.17: 0.20.17Compare Source
$defaultvalues to work with new local drizzle studio. You will be forced to upgrade drizzle-kitv0.20.16Compare Source
0.20.15bugs and force to upgrade from studio UIv0.20.15Compare Source
v0.20.14: 0.20.14Compare Source
<0.20.0to0.20.0+, if you have composite primary keys and are using thegeneratecommand only for SQLite database, you may encounter amalformederror from drizzle-kit for all snapshots. This issue has been fixed in this versionv0.20.13: 0.20.13Compare Source
v0.20.12: 0.20.12Compare Source
Made
schemaTooptional during the serialize step, preventing unnecessary drop+create foreign key statements from appearing.Fixed an issue: when using a barrel file, drizzle-kit was exporting duplicated tables, leading to an error with multiple indexes having the same name. It should now remove duplicates and function as expected
v0.20.11: 0.20.11Compare Source
v0.20.10: 0.20.10Compare Source
v0.20.9: 0.20.9Compare Source
v0.20.8: 0.20.8Compare Source
Bug Fixes
introspectandpushfor PlanetScale. A newly added feature to PlanetScale was not functioning properly with the 'drizzle-kit introspect' and 'push' commands, failing to retrieve foreign keys from a database. This issue should now be resolvedNew Drivers
🎉 Expo SQLite Driver is available
For starting with Expo SQLite Driver, you need to install
expo-sqliteanddrizzle-ormpackages.Then, you can use it like this:
If you want to use Drizzle Migrations, you need to update babel and metro configuration files.
babel-plugin-inline-importpackage.babel.config.jsandmetro.config.jsfiles.babel.config.js
module.exports = function(api) { api.cache(true); return { presets: ['babel-preset-expo'], + plugins: [["inline-import", { "extensions": [".sql"] }]] }; };metro.config.js
const { getDefaultConfig } = require('expo/metro-config'); /** @​type {import('expo/metro-config').MetroConfig} */ const config = getDefaultConfig(__dirname); +config.resolver.sourceExts.push('sql'); module.exports = config;drizzle.config.tsfile in your project root folder.After creating schema file and drizzle.config.ts file, you can generate migrations like this:
Then you need to import
migrations.jsfile in yourApp.tsxfile from./drizzlefolder and use hookuseMigrationsormigratefunction.v0.20.7: 0.20.7Compare Source
Bug fixes
Improvements
v0.20.6Compare Source
v0.20.5Compare Source
v0.20.4Compare Source
v0.20.3Compare Source
v0.20.2Compare Source
v0.20.1Compare Source
v0.20.0: 0.20.0Compare Source
New Features
New way to define drizzle.config using
defineConfigfunctionPossibility to access Cloudflare D1 with Drizzle Studio using wrangler.toml file
You can now use Drizzle Studio with your D1 database. Please note that it may be slow at times because Drizzle Studio utilizes Wrangler CLI calls to perform data selection, updates, deletions, and insertions. The speed of these operations depends on the performance of Wrangler CLI calls.
To use Drizzle Studio with the D1 database, you need to provide the file path to your
wrangler.tomlfile and specify thedbNameyou are using in Cloudflare D1And then run
drizzle-kit studioDrizzle Studio is migrating to https://local.drizzle.studio/
Previously, Drizzle Studio used
127.0.0.1:4983as the default host and port for the web page. Currently, Drizzle Studio will always be hosted onhttps://local.drizzle.studio/, connecting to the backend at127.0.0.1:4983. You can modify the host and port for the backend server by using the--hostand--portoptions indrizzle-kit studio.local.drizzle.studioprovides the ability to ship updates to the Drizzle Studio web UI immediately, eliminating the need for constantdrizzle-kitupgradesbigint unsignedsupportThis option is now available in the introspect, push, and generate commands.
primaryKeysandforeignKeysnow can have custom namesThis option is now available in the introspect, push, and generate commands.
Environment variables are now fetched automatically
As mentioned many times, you can finally skip fetching environment variables to use with the
drizzle.configfile. Drizzle Kit will handle this process automatically.Drizzle Studio Updates
publicwill be the default, and the only choice.Improvements
libsql_wasm_func_tablefrom sqlite introspect and pushprimaryKeycolumns order for composite constraintsBug Fixes
tursoorlibsqldriver user was seeing an error with nobetter-sqlite3dependencytableFiltersto cli options in all push commandsConfiguration
📅 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 has been generated by Mend Renovate. View repository job log here.