Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency drizzle-kit to v0.23.0 #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 31, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
drizzle-kit 0.21.4 -> 0.23.0 age adoption passing confidence

Release Notes

drizzle-team/drizzle-kit-mirror (drizzle-kit)

v0.23.0

Compare Source

v0.22.8: 0.22.8

Compare Source

v0.22.7

Compare Source

v0.22.6: 0.22.6

Compare Source

  • πŸ› Fixed drizzle-kit up of snapshots from v6 to v7
  • πŸ› [BUG]: extensionsFilters: ['postgis'] still trying to delete spatial_ref_sys - #​2464

v0.22.5: 0.22.5

Compare Source

  • πŸ› [BUG]: Recreating pg index in version 0.31(orm) + 0.22(kit) fails - #​2470
  • πŸ› [BUG]: Drizzle migrator doesn't work with uppercase names when creating indexes - #​2457
  • πŸ› [BUG]: 'left' column name not escaped in index - #​2425
  • πŸ› [BUG]: drizzle-kit push TypeError Cannot use 'in' operator to search for 'default' in undefined - #​2385
  • πŸ› [BUG]: Breaking change in the new "PostgreSQL Indexes API" missing quotes for uppercase column letters - #​2413
  • πŸ› [BUG]: drizzle-kit migrate fail "applying migrations...error: column "authorid" does not exist" - #​2423

v0.22.4: 0.22.4

Compare Source

  • Removed data loss triggers on push when adding a NOT NULL constraint to a column and when removing the default value from a column. These actions will now be performed immediately, and if there are any NULL values in the column, you will receive an error from the database

v0.22.3: 0.22.3

Compare Source

  • πŸ› Fix Cannot use 'in' operator to search for 'default' in undefined error on push and generate

v0.22.2: 0.22.2

Compare Source

  • πŸ› Fixed index-on-expressions sql statement generation if the expression contains a ,. This should fix problems for tsvector indexes, such as:
titleSearchIndex: index('title_search_index').using('gin', sql`to_tsvector('english', ${table.title})`)

v0.22.1: 0.22.1

Compare Source

Bug fixes
  • πŸ› [BUG]: postgis geometry error: type "geometry(point)" does not exist
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.0

Compare 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

  • No way to define SQL expressions inside .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.
// Index declaration reference
index('name')
  .on(table.column1, table.column2, ...) or .onOnly(table.column1, table.column2, ...)
  .concurrently()
  .using(sql``) // sql expression
  .asc() or .desc()
  .nullsFirst() or .nullsLast()
  .where(sql``) // sql expression

Current API

// First example, with `.on()`
index('name')
  .on(table.column1.asc(), table.column2.nullsFirst(), ...) or .onOnly(table.column1.desc().nullsLast(), table.column2, ...)
  .concurrently()
  .where(sql``)
  .with({ fillfactor: '70' })

// Second Example, with `.using()`
index('name')
  .using('btree', table.column1.asc(), sql`lower(${table.column2})`, table.column1.op('text_ops'))
  .where(sql``) // sql expression
  .with({ fillfactor: '70' })

πŸŽ‰ Support for new types

Drizzle Kit can now handle:

  • point and line from PostgreSQL
  • vector from the PostgreSQL pg_vector extension
  • geometry from the PostgreSQL PostGIS 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 use push or introspect, all those tables will be included in diff operations. In this case, you would need to specify tablesFilter, 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 the public schema.

The postgis option will skip the geography_columns, geometry_columns, and spatial_ref_sys tables

import { defineConfig } from 'drizzle-kit'

export default defaultConfig({
  dialect: "postgresql",
  extensionsFilters: ["postgis"],
})

Improvements

πŸ‘ 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
import { defineConfig } from 'drizzle-kit'

export default defaultConfig({
  dialect: "postgresql",
  dbCredentials: {
    ssl: true, //"require" | "allow" | "prefer" | "verify-full" | options from node:tls
  }
})
import { defineConfig } from 'drizzle-kit'

export default defaultConfig({
  dialect: "mysql",
  dbCredentials: {
    ssl: "", // string | SslOptions (ssl options from mysql2 package)
  }
})
πŸ‘ Normilized SQLite urls for libsql and better-sqlite3 drivers

Those 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

export const users = sqliteTable(
  'users',
  {
    id: integer('id').primaryKey(),
    email: text('email').notNull(),
  },
  (table) => ({
    emailUniqueIndex: uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
  }),
);
-- before
CREATE UNIQUE INDEX `emailUniqueIndex` ON `users` (`lower("users"."email")`);

-- now
CREATE UNIQUE INDEX `emailUniqueIndex` ON `users` (lower("email"));

Bug Fixes

  • [BUG]: multiple constraints not added (only the first one is generated) - #​2341
  • Drizzle Studio: Error: Connection terminated unexpectedly - #​435
  • Unable to run sqlite migrations local - #​432
  • error: unknown option '--config' - #​423

How push and generate works for indexes

Limitations
You should specify a name for your index manually if you have an index on at least one expression

Example

index().on(table.id, table.email) // will work well and name will be autogeneretaed
index('my_name').on(table.id, table.email) // will work well

// but

index().on(sql`lower(${table.email})`) // error
index('my_name').on(sql`lower(${table.email})`) // will work well
Push won't generate statements if these fields(list below) were changed in an existing index:
  • expressions inside .on() and .using()
  • .where() statements
  • operator classes .op() on columns

If you are using push workflows and want to change these fields in the index, you would need to:

  • Comment out the index
  • Push
  • Uncomment the index and change those fields
  • Push again

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.


Configuration

πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - "before 4am" (UTC).

🚦 Automerge: Enabled.

β™» 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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the bump bump deps label May 31, 2024
@renovate renovate bot force-pushed the renovate/drizzle-kit-0.x branch from 32f2d21 to d05af74 Compare May 31, 2024 14:29
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.0 chore(deps): update dependency drizzle-kit to v0.22.1 May 31, 2024
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.1 chore(deps): update dependency drizzle-kit to v0.22.2 Jun 4, 2024
@renovate renovate bot force-pushed the renovate/drizzle-kit-0.x branch 2 times, most recently from c457753 to df5a536 Compare June 6, 2024 15:28
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.2 chore(deps): update dependency drizzle-kit to v0.22.3 Jun 6, 2024
@renovate renovate bot force-pushed the renovate/drizzle-kit-0.x branch from df5a536 to 919133e Compare June 6, 2024 18:18
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.3 chore(deps): update dependency drizzle-kit to v0.22.4 Jun 6, 2024
@renovate renovate bot force-pushed the renovate/drizzle-kit-0.x branch from 919133e to c080f21 Compare June 7, 2024 15:14
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.4 chore(deps): update dependency drizzle-kit to v0.22.5 Jun 7, 2024
@renovate renovate bot force-pushed the renovate/drizzle-kit-0.x branch from c080f21 to 0c0f7f4 Compare June 8, 2024 13:39
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.5 chore(deps): update dependency drizzle-kit to v0.22.6 Jun 8, 2024
@renovate renovate bot force-pushed the renovate/drizzle-kit-0.x branch from 0c0f7f4 to 46ec3bf Compare June 10, 2024 15:15
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.6 chore(deps): update dependency drizzle-kit to v0.22.7 Jun 10, 2024
@renovate renovate bot force-pushed the renovate/drizzle-kit-0.x branch from 46ec3bf to 9e31e78 Compare June 29, 2024 13:14
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.7 chore(deps): update dependency drizzle-kit to v0.22.8 Jun 29, 2024
@renovate renovate bot force-pushed the renovate/drizzle-kit-0.x branch from 9e31e78 to 547a16d Compare July 10, 2024 13:18
@renovate renovate bot changed the title chore(deps): update dependency drizzle-kit to v0.22.8 chore(deps): update dependency drizzle-kit to v0.23.0 Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump bump deps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants