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.0
Release Notes
drizzle-team/drizzle-kit-mirror (drizzle-kit)
v0.23.0
Compare Source
v0.22.8
: 0.22.8Compare Source
v0.22.7
Compare Source
v0.22.6
: 0.22.6Compare Source
drizzle-kit up
of snapshots from v6 to v7v0.22.5
: 0.22.5Compare Source
v0.22.4
: 0.22.4Compare Source
data loss
triggers onpush
when adding aNOT NULL
constraint to a column and when removing thedefault
value from a column. These actions will now be performed immediately, and if there are anyNULL
values 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 undefined
error on push and generatev0.22.2
: 0.22.2Compare Source
,
. This should fix problems fortsvector
indexes, 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
..using
and.on
in 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:
point
andline
from PostgreSQLvector
from the PostgreSQLpg_vector
extensiongeometry
from the PostgreSQLPostGIS
extension🎉 New param in drizzle.config -
extensionsFilters
The PostGIS extension creates a few internal tables in the
public
schema. This means that if you have a database with the PostGIS extension and usepush
orintrospect
, all those tables will be included indiff
operations. 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
extensionsFilters
with the name of the extension used, and Drizzle will skip all the necessary tables.Currently, we only support the
postgis
option, but we plan to add more extensions if they create tables in thepublic
schema.The
postgis
option will skip thegeography_columns
,geometry_columns
, andspatial_ref_sys
tablesImprovements
👍 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
libsql
andbetter-sqlite3
driversThose 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
push
andgenerate
works 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
push
workflows and want to change these fields in the index, you would need to:For the
generate
command,drizzle-kit
will 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.4
Compare Source
bug fixes
node-pg
pool connection halting, regression introduced in previous release while migrating fromclient
topool
with max 1 connectionv0.21.3
Compare Source
Cloudflare D1 HTTP API support 🎉
Drizzle Chrome Extension now has support for Cloudflare D1!
Drizzle Kit now lets you run
migrate
,push
,introspect
andstudio
commands using Cloudflare D1 HTTP API, you just need to update connection params indrizzle.config.ts
:You can find
accountId
,databaseId
andtoken
in Cloudflare dashboardTo get
accountId
go to Workers & Pages -> Overview -> copy Account ID from the right sidebarTo get
databaseId
open D1 database you want to connect to and copy Database IDTo get
token
go to My profile -> API Tokens and create token with D1 edit permissionsBug fixes
check
command #2284postgres
dialect #2346v0.21.2
Compare Source
Bug fixes
A list of regressions after
0.21.0
that were fixed (there are more, and those should be fixed in the next patch releases):generate
andpush
were not detecting new columns added.push
Tickets that were closed
v0.21.1
Compare 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.0
Compare 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-kit
cli commandsYou can now just use commands, like:
drizzle-kit generate
drizzle-kit push
without specifying dialect. This param is moved to
drizzle.config.ts
❗
drizzle.config
updatedialect
is now mandatory; specify which database dialect you are connecting to. Options includemysql
,postgresql
, orsqlite
.driver
has become optional and will have a specific driver, each with a different configuration ofdbCredentials
. Available drivers are:aws-data-api
turso
d1-http
- currently WIPexpo
url
- a unified parameter for the previously existingconnectionString
anduri
.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
driver
is specified, use this driver for querying.If no driver is specified:
For
postgresql
dialect, Drizzle will:pg
driver is installed and use it.postgres
driver and use it.@vercel/postgres
.@neondatabase/serverless
.For
mysql
dialect, Drizzle will:mysql2
driver is installed and use it.@planetscale/database
and use it.For
sqlite
dialect, Drizzle will:@libsql/client
driver is installed and use it.better-sqlite3
and 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
relations
from the database by extracting foreign key information and translating it into arelations
object. You can view therelations.ts
file in theout
folder 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
migrate
You can now apply generated migrations to your database directly from
drizzle-kit
Usage
By default, drizzle-kit will store migration data entries in the
__drizzle_migrations
table and, in the case of PostgreSQL, in adrizzle
schema. If you want to change this, you will need to specify the modifications indrizzle.config.ts
.How to migrate from
0.20.18
to0.21.0
1. Remove all
:dialect
prefixes from your Drizzle-Kit commands.Example: Change
drizzle-kit push:mysql
todrizzle-kit push
.2. Update your
drizzle.config.ts
file:dialect
todrizzle.config.ts
. It is now mandatory and can be 'postgresql', 'mysql', or 'sqlite'.driver
todrizzle.config.ts
ONLY if you are usingaws-data-api
,turso
,d1-http
(WIP), orexpo
. Otherwise, you can remove thedriver
fromdrizzle.config.ts
.connectionString
oruri
indbCredentials
, you should now useurl
.3. If you are using PostgreSQL and had migrations generated in your project, please run
drizzle-kit up
so Drizzle can upgrade all the snapshots to version 6.v0.20.18
Compare Source
v0.20.17
: 0.20.17Compare Source
$default
values to work with new local drizzle studio. You will be forced to upgrade drizzle-kitv0.20.16
Compare Source
0.20.15
bugs and force to upgrade from studio UIv0.20.15
Compare Source
v0.20.14
: 0.20.14Compare Source
<0.20.0
to0.20.0+
, if you have composite primary keys and are using thegenerate
command only for SQLite database, you may encounter amalformed
error 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
schemaTo
optional 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
introspect
andpush
for 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-sqlite
anddrizzle-orm
packages.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-import
package.babel.config.js
andmetro.config.js
files.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.ts
file 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.js
file in yourApp.tsx
file from./drizzle
folder and use hookuseMigrations
ormigrate
function.v0.20.7
: 0.20.7Compare Source
Bug fixes
Improvements
v0.20.6
Compare Source
v0.20.5
Compare Source
v0.20.4
Compare Source
v0.20.3
Compare Source
v0.20.2
Compare Source
v0.20.1
Compare Source
v0.20.0
: 0.20.0Compare Source
New Features
New way to define drizzle.config using
defineConfig
functionPossibility 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.toml
file and specify thedbName
you are using in Cloudflare D1And then run
drizzle-kit studio
Drizzle Studio is migrating to https://local.drizzle.studio/
Previously, Drizzle Studio used
127.0.0.1:4983
as 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--host
and--port
options indrizzle-kit studio
.local.drizzle.studio
provides the ability to ship updates to the Drizzle Studio web UI immediately, eliminating the need for constantdrizzle-kit
upgradesbigint unsigned
supportThis option is now available in the introspect, push, and generate commands.
primaryKeys
andforeignKeys
now 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.config
file. Drizzle Kit will handle this process automatically.Drizzle Studio Updates
public
will be the default, and the only choice.Improvements
libsql_wasm_func_table
from sqlite introspect and pushprimaryKey
columns order for composite constraintsBug Fixes
turso
orlibsql
driver user was seeing an error with nobetter-sqlite3
dependencytableFilters
to 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.