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

fix(deps): update all non-major dependencies (minor) #140

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 21, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@panva/hkdf 1.1.1 -> 1.2.0 age adoption passing confidence
@pulumi/hcloud (source) 1.18.1 -> 1.19.1 age adoption passing confidence
@pulumi/pulumi (source) 3.112.0 -> 3.120.0 age adoption passing confidence
drizzle-kit 0.20.14 -> 0.22.7 age adoption passing confidence
drizzle-orm (source) 0.30.8 -> 0.31.2 age adoption passing confidence
fastify (source) 4.26.2 -> 4.28.0 age adoption passing confidence
glob 10.3.12 -> 10.4.2 age adoption passing confidence
jose 5.2.4 -> 5.4.1 age adoption passing confidence
pino (source) 8.20.0 -> 8.21.0 age adoption passing confidence
tsx (source) 4.7.2 -> 4.15.7 age adoption passing confidence
typescript (source) 5.4.5 -> 5.5.2 age adoption passing confidence
undici (source) 6.12.0 -> 6.19.2 age adoption passing confidence
zod (source) 3.22.4 -> 3.23.8 age adoption passing confidence

Release Notes

panva/hkdf (@​panva/hkdf)

v1.2.0

Compare Source

Features
  • add bun, deno, and workerd package.json targets (d8a424c)
pulumi/pulumi-hcloud (@​pulumi/hcloud)

v1.19.1

Compare Source

Changelog

v1.19.0

Compare Source

Changelog

pulumi/pulumi (@​pulumi/pulumi)

v3.120.0

Compare Source

Features
  • [components/dotnet] Upgrade dotnet to 3.64.0
    #​16353

  • [cli/import] Add flag --json to pulumi import which would serialize the import diffs, operations, and overall output as JSON
    #​16342

  • [engine] Change pulumi refresh to report diffs relative to desired state instead of relative to only output changes. Use PULUMI_ENABLE_LEGACY_REFRESH_DIFF to revert to the old behaviour.

  • [protobuf] Pass ProgramInfo to LanguageRuntime.About
    #​16311

  • [sdk/python] Support Poetry as Python toolchain
    #​16315

  • [sdk/python] Autoinstall dependencies using Poetry in GetRequiredPlugins
    #​16315

Bug Fixes
  • [cli/{config,new}] Fix non-interactive flag for 'new' and 'config env' commands"
    #​16338

  • [programgen/go] Fix union type resolution in Go program generation
    #​16297

  • [sdk/nodejs] Only look for main in package.json if no entyrpoint was set via Pulumi.yaml
    #​16363

  • [sdk/python] Make sure no resource registrations are in progress while stack transforms are being registered

Miscellaneous
  • [pkg] Refactor plugin.Provider to a Method(context.Context, MethodRequest) (MethodResponse, error) style interface.
    #​16302

  • [programgen/nodejs] Sort dependencies in GenerateProject
    #​16341

  • [sdk/nodejs] Update current nodejs version to 22.x
    #​16378

v3.119.0

Compare Source

Features
  • [cli] Incorporate v0.9.1 of the esc CLI.
    #​16322

  • [auto/{go,nodejs,python}] Add support for --all parameter of the stack ls command to the Automation API
    #​16266

  • [components/yaml] Upgrade pulumi-yaml to 1.8.0
    #​16325

Bug Fixes
  • [cli/new] Populate pulumi:template tag also for interactively selected templates
    #​16308

  • [backend/service] Improve error reporting when policy pack download fails
    #​16306

Miscellaneous
  • [sdk/python] Move dependency installation and python command invocation to Toolchain interface
    #​16243

v3.118.0

Compare Source

Features
  • [sdk] Improve plugin parameterize interface
    #​16283

  • [sdk] Require consumers to set an explicit forward compatibility policy for forward compatibility in plugin.Provider
    #​16293

  • [programgen/go] Implement importPathPattern in Go language options to override emitted paths in generated Go programs
    #​16267

  • [sdk/{go,nodejs,python}] Make stack transforms a stable, non-experimental feature
    #​16282

Bug Fixes
  • [auto/go] Add missing ContinueOnError option function
    #​16291

  • [cli/display] Don't rewrite in-progress replacement steps if an error occurs
    #​16292

  • [docs] Fix generating constructor examples for resources that have numeric enums as input
    #​16223

  • [engine] Fix panic with --continue-on-error on delete after failed create
    #​16261

v3.117.0

Compare Source

Features
  • [engine] Guess ID references of dependant resources when generating code for import operations
    #​16208
Bug Fixes
  • [engine] Check property dependencies and deleted-with relationships for target dependents
    #​16220

  • [engine] Propagate dependencies of untargeted resources correctly during targeted updates
    #​16247

  • [backend/diy] Rewrite DeletedWith references when renaming stacks
    #​16216

  • [cli/state] Fix state renames involving DeletedWith
    #​16260

  • [sdk/python] Use a separate type variable for static methods on Output
    #​16172

  • [sdk/python] Relax Output.all types to better match the implementation
    #​16172

  • [sdkgen/python] Generate init.py files for modules that only contain enumerations
    #​16229

v3.116.1

Compare Source

Features
  • [docs] Resource docs: bump the number of displayed supporting types from 200 to 1000 by default
    #​16185

  • [sdk/go] Prefer pluginDownloadURLOverrides over PluginDownloadURL specified in the package
    #​16186

Bug Fixes
  • [engine] Fix panic when using pulumi up --refresh --continue-on-error
    #​16184

v3.116.0

Compare Source

v3.115.2

Compare Source

3.115.2 (2024-05-06)

Bug Fixes
  • [cli/display] Fix a deadlock in the display code
    #​16129

  • [cli/engine] Revert "Make --expect-no-changes fail even if the only changes are output changes"
    #​16131

  • [engine] Normalize provider version during default provider lookup
    #​16109

v3.115.1

Compare Source

Bug Fixes
  • [backend] Fix concurrent reads from and writes to display resource timer maps
    #​16101

  • [engine] Better handle property dependencies and deleted-with relationships when pruning URNs, verifying snapshot integrity and computing dependency graphs.
    #​16088

  • [engine] Fix folder archive outside of cwd.

  • [programgen/python] Sort generated requirements.txt files when generating Python programs
    #​16115

v3.115.0

Compare Source

3.115.0 (2024-05-02)

Features
  • [auto/{go,nodejs,python}] Add support for --import-file option on Preview with Automation API
    #​16071

  • [sdk/{go,nodejs,python}] Make transforms a stable, non-experimental feature
    #​16080

  • [sdk/python] Update python dynamic provider types for inputs to Dict[str, Any], from Any
    #​16102

  • [components/yaml] Upgrade pulumi-yaml to 1.7.0
    #​16082

Bug Fixes
  • [engine] Fix an issue with archives/assets at paths outside cwd.
    #​16100

  • [cli/display] Avoid showing a diff when the provider returns DIFF_NONE
    #​16024

  • [backend/{diy,service}] Promote snapshot closure errors from diagnostics to actual errors
    #​16090

  • [cli/engine] Make --expect-no-changes fail even if the only changes are output changes
    #​15903

v3.114.0

Compare Source

3.114.0 (2024-04-26)

Features
  • [auto/{go,nodejs,python}] Add support for the continue-on-error parameter of the up command to the Automation API
    #​15953

  • [engine] Add a --continue-on-error flag to pulumi up
    #​15740

Bug Fixes
  • [pkg] Deserialize assets with their sig
    #​16073

  • [cli/display] Fix output of the diff display, making sure it shows diffs from refreshes
    #​16065

  • [auto/python] Ensure async context is not shared between multiple programs
    #​16063

  • [sdk/nodejs] Fix a race condition that could cause the NodeJS runtime to terminate before finishing all work
    #​16005

  • [sdk/python] Fix an exception when setting providers resource option with a dict
    #​16022

  • [sdk/python] Fix event loop tracking in the python SDK when using remote transforms
    #​16039

  • [sdk/python] Workaround lazy module loading regression
    #​16038

  • [sdk/python] Fix a memory leak in tracking outputs
    #​16057

Miscellaneous
  • [cli/plugin] Move PluginKind type definition into apitype and re-export for backward compatibility
    #​15946

v3.113.3

Compare Source

3.113.3 (2024-04-19)

Features
  • [cli/about] Add plugin kind to the about output
    #​15996
Bug Fixes
  • [engine] Remove locks between snapshot and executor systems
    #​15998

v3.113.2

Compare Source

3.113.2 (2024-04-18)

Features
  • [backend/{diy,service}] Elide state file writes for unchanged component outputs
    #​15976
Bug Fixes
  • [engine] Display the entire preview with diff when a protected resource needs replacement
    #​15969

v3.113.1

Compare Source

3.113.1 (2024-04-18)

Features
  • [auto/{go,nodejs,python}] Add support for inheritSettings to go, nodejs and python automation API.
    #​15684
Bug Fixes
  • [backend] Fix incorrect dependency sorting in snapshot

v3.113.0

Compare Source

3.113.0 (2024-04-15)

Features
  • [sdk/nodejs] Make TypeScript and ts-node optional peer dependencies to allow using user specified versions
    #​15622

    Note: TypeScript and ts-node are now optional peer dependencies of the Node.js SDK. This makes its possible to chose any version of these packages by adding them as dependency or devDependency to your package.json. If these optional peer dependencies are not installed, Pulumi will fallback to bundled versions included in the Node.js SDK to maintain backwards compatibility. As a side effect of this change, the tsc binary is no longer available in node_modules/.bin/tsc. If you rely on tsc being available in your project, add it as a dependency or devDependency to your package.json.

  • [sdk/python] Add 'typeChecker' runtime option to the Python language host
    #​15725

  • [auto/{go,nodejs,python}] Add support for continue-on-error parameter of the destroy command to the Automation API
    #​15921

  • [cli] Support always fully qualifying stack names in CLI output
    #​15857

  • [cli] Add --no-plugins and --no-dependencies to pulumi install
    #​15910

  • [docs] Implement Java constructor syntax examples
    #​15805

  • [sdk/go] Allow unknowns during pulumi up
    #​15942

  • [sdk/{nodejs,python}] Allow apply to have unknown values during updates
    #​15898

Bug Fixes
  • [auto] Tolerate missing stack and bookkeeping files in ProgramTest
    #​15863

  • [backend/diy] Fix race condition when listing stacks
    #​15931

  • [cli] Fix a panic when user's home directory could not be looked up
    #​15872

  • [cli] Fix some commands that didn't respect --disable-integrity-checking
    #​15911

  • [auto/go] Avoid flakyness when reading the event log from pulumi commands
    #​15856

  • [engine] Resource transforms on component resources now apply to children correctly
    #​15846

  • [programgen/dotnet] Remove trailing whitespace from emitted DependsOn resource option expressions
    #​15892

  • [sdk/go] Fix Provider and Providers options in Go transform functions
    #​15885

  • [sdk/nodejs] Handle serialization of aliases for well known native functions
    #​15873

  • [sdk/nodejs] Correctly serialise functions whose code would make use of reserved identifiers
    #​15879

  • [sdk/nodejs] Serialize function values obtained from Function.bind
    #​15887

  • [sdk/python] Improve types of getters in Python SDK
    #​15865

  • [sdkgen/{dotnet,go}] Fix SDK-generation when referencing shared types in config variables
    #​15772

Miscellaneous
  • [backend/diy] Upgrade gocloud.dev dependency to 0.37
    #​15924

  • [sdk/nodejs] Update builtin module list for function serialization
    #​15830

  • [sdk/nodejs] Set package.json engines to node >= 18
    #​15845

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

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.

v0.21.4

Compare Source

bug fixes

  • fix node-pg pool connection halting, regression introduced in previous release while migrating from client to pool with max 1 connection

v0.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 and studio commands using Cloudflare D1 HTTP API, you just need to update connection params in drizzle.config.ts:

dialect: "sqlite",
+ driver: "d1-http",
dbCredentials: {
+  accountId: "...",
+  databaseId: "...",
+  token: "...",
}

You can find accountId, databaseId and token in Cloudflare dashboard
To get accountId go to Workers & Pages -> Overview -> copy Account ID from the right sidebar
To get databaseId open D1 database you want to connect to and copy Database ID
To get token go to My profile -> API Tokens and create token with D1 edit permissions

Bug fixes

v0.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):

  • SQLite generate and push were not detecting new columns added.
  • Timestamps with precision in Postgres were always detected as a change on push
  • Unique constraints for PostgreSQL were not generated and pushed
  • When adding columns to SQLite, table name was not escaped

Tickets that were closed

  • 🐛 [BUG]:"drizzle-kit generate" doesn't generate a migration file when a column is added - 2307
  • 🐛 [BUG]: Unique constraint is not added to the change - 2302
  • 🐛 [bug]: drizzle-kit push is not detecting changes correctly (Turso) - #​397

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!

image

image

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 commands

You can now just use commands, like:

  • drizzle-kit generate
  • drizzle-kit push
  • etc.

without specifying dialect. This param is moved to drizzle.config.ts

drizzle.config update
  • dialect is now mandatory; specify which database dialect you are connecting to. Options include mysql, postgresql, or sqlite.
  • driver has become optional and will have a specific driver, each with a different configuration of dbCredentials. Available drivers are:
    • aws-data-api
    • turso
    • d1-http - currently WIP
    • expo
  • url - a unified parameter for the previously existing connectionString and uri.
  • 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

import { defineConfig } from "drizzle-kit"

export default defineConfig({
    dialect: "sqlite", // "postgresql" | "mysql"
    driver: "turso"
    dbCredentials: {
        url: ""
    },
    migration: {
        table: "migrations",
        schema: "public"
    }
})

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:

    • Check if the pg driver is installed and use it.
    • If not, try to find the postgres driver and use it.
    • If still not found, try to find @vercel/postgres.
    • Then try @neondatabase/serverless.
    • If nothing is found, an error will be thrown.
  • For mysql dialect, Drizzle will:

    • Check if the mysql2 driver is installed and use it.
    • If not, try to find @planetscale/database and use it.
    • If nothing is found, an error will be thrown.
  • For sqlite dialect, Drizzle will:

    • Check if the @libsql/client driver is installed and use it.
    • If not, try to find better-sqlite3 and use it.
    • If nothing is found, an error will be thrown
❗ 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 a relations object. You can view the relations.ts file in the out folder after introspection is complete

For 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

drizzle-kit generate --name init_db
🎉 New command migrate

You can now apply generated migrations to your database directly from drizzle-kit

Usage

drizzle-kit migrate

By default, drizzle-kit will store migration data entries in the __drizzle_migrations table and, in the case of PostgreSQL, in a drizzle schema. If you want to change this, you will need to specify the modifications in drizzle.config.ts.

import { defineConfig } from "drizzle-kit"

export default defineConfig({
    migrations: {
        table: "migrations",
        schema: "public"
    }
})
How to migrate from 0.20.18 to 0.21.0
1. Remove all :dialect prefixes from your Drizzle-Kit commands.

Example: Change drizzle-kit push:mysql to drizzle-kit push.

2. Update your drizzle.config.ts file:
  • Add dialect to drizzle.config.ts. It is now mandatory and can be 'postgresql', 'mysql', or 'sqlite'.
  • Add driver to drizzle.config.ts ONLY if you are using aws-data-api, turso, d1-http(WIP), or expo. Otherwise, you can remove the driver from drizzle.config.ts.
  • If you were using connectionString or uri in dbCredentials, you should now use url.
import { defineConfig } from "drizzle-kit"

export default defineConfig({
    dialect: "sqlite", // "postgresql" | "mysql"
    driver: "turso" // optional and used only if `aws-data-api`, `turso`, `d1-http`(WIP) or `expo` are used
    dbCredentials: {
        url: ""
    }
})
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.17

Compare Source

  • Fixed $default values to work with new local drizzle studio. You will be forced to upgrade drizzle-kit

v0.20.16

Compare Source

  • Fixed 0.20.15 bugs and force to upgrade from studio UI

v0.20.15

Compare Source

  • Moving server instantiations from Local Drizzle Studio to drizzle-kit. Local Studio will now require an upgrade to the latest version of drizzle-kit
drizzle-team/drizzle-orm (drizzle-orm)

v0.31.2

Compare Source

  • 🎉 Added support for TiDB Cloud Serverless driver:

    import { connect } from '@&#8203;tidbcloud/serverless';
    import { drizzle } from 'drizzle-orm/tidb-serverless';
    
    const client = connect({ url: '...' });
    const db = drizzle(client);
    await db.select().from(...);

v0.31.1

Compare Source

New Features

Live Queries 🎉

For a full explanation about Drizzle + Expo welcome to discussions

As of v0.31.1 Drizzle ORM now has native support for Expo SQLite Live Queries!
We've implemented a native useLiveQuery React Hook which observes necessary database changes and automatically re-runs database queries. It works with both SQL-like and Drizzle Queries:

import { useLiveQuery, drizzle } from 'drizzle-orm/expo-sqlite';
import { openDatabaseSync } from 'expo-sqlite/next';
import { users } from './schema';
import { Text } from 'react-native';

const expo = openDatabaseSync('db.db', { enableChangeListener: true }); // <-- enable change listeners
const db = drizzle(expo);

const App = () => {
  // Re-renders automatically when data changes
  const { data } = useLiveQuery(db.select().from(users));

  // const { data, error, updatedAt } = useLiveQuery(db.query.users.findFirst());
  // const { data, error, updatedAt } = useLiveQuery(db.query.users.findMany());

  return <Text>{JSON.stringify(data)}</Text>;
};

export default App;

We've intentionally not changed the API of ORM itself to stay with conventional React Hook API, so we have useLiveQuery(databaseQuery) as opposed to db.select().from(users).useLive() or db.query.users.useFindMany()

We've also decided to provide data, error and updatedAt fields as a result of hook for concise explicit error handling following practices of React Query and Electric SQL

v0.31.0

Compare Source

Breaking changes

Note: drizzle-orm@0.31.0 can be used with drizzle-kit@0.22.0 or higher. The same applies to Drizzle Kit. If you run a Drizzle Kit command, it will check and prompt you for an upgrade (if needed). You can check for Drizzle Kit updates. below

PostgreSQL indexes API was changed

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' })

New Features

🎉 "pg_vector" extension support

There is no specific code to create an extension inside the Drizzle schema. We assume that if you are using vector types, indexes, and queries, you have a PostgreSQL database with the pg_vector extension installed.

You can now specify indexes for pg_vector and utilize pg_vector functions for querying, ordering, etc.

Let's take a few examples of pg_vector indexes from the pg_vector docs and translate them to Drizzle

L2 distance, Inner product and Cosine distance
// CREATE INDEX ON items USING hnsw (embedding vector_l2_ops);
// CREATE INDEX ON items USING hnsw (embedding vector_ip_ops);
// CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops);

const table = pgTable('items', {
    embedding: vector('embedding', { dimensions: 3 })
}, (table) => ({
    l2: index('l2_index').using('hnsw', table.embedding.op('vector_l2_ops'))
    ip: index('ip_index').using('hnsw', table.embedding.op('vector_ip_ops'))
    cosine: index('cosine_index').using('hnsw', table.embedding.op('vector_cosine_ops'))
}))
L1 distance, Hamming distance and Jaccard distance - added in pg_vector 0.7.0 version
// CREATE INDEX ON items USING hnsw (embedding vector_l1_ops);
// CREATE INDEX ON items USING hnsw (embedding bit_hamming_ops);
// CREATE INDEX ON items USING hnsw (embedding bit_jaccard_ops);

const table = pgTable('table', {
    embedding: vector('embedding', { dimensions: 3 })
}, (table) => ({
    l1: index('l1_index').using('hnsw', table.embedding.op('vector_l1_ops'))
    hamming: index('hamming_index').using('hnsw', table.embedding.op('bit_hamming_ops'))
    bit: index('bit_jaccard_index').using('hnsw', table.embedding.op('bit_jaccard_ops'))
}))

For queries, you can use predefined functions for vectors or create custom ones using the SQL template operator.

You can also use the following helpers:

import { l2Distance, l1Distance, innerProduct, 
          cosineDistance, hammingDistance, jaccardDistance } from 'drizzle-orm'

l2Distance(table.column, [3, 1, 2]) // table.column <-> '[3, 1, 2]'
l1Distance(table.column, [3, 1, 2]) // table.column <+> '[3, 1, 2]'

innerProduct(table.column, [3, 1, 2]) // table.column <#> '[3, 1, 2]'
cosineDistance(table.column, [3, 1, 2]) // table.column <=> '[3, 1, 2]'

hammingDistance(table.column, '101') // table.column <~> '101'
jaccardDistance(table.column, '101') // table.column <%> '101'

If pg_vector has some other functions to use, you can replicate implimentation from existing one we have. Here is how it can be done

export function l2Distance(
  column: SQLWrapper | AnyColumn,
  value: number[] | string[] | TypedQueryBuilder<any> | string,
): SQL {
  if (is(value, TypedQueryBuilder<any>) || typeof value === 'string') {
    return sql`${column} <-> ${value}`;
  }
  return sql`${column} <-> ${JSON.stringify(value)}`;
}

Name it as you wish and change the operator. This example allows for a numbers array, strings array, string, or even a select query. Feel free to create any other type you want or even contribute and submit a PR

Examples

Let's take a few examples of pg_vector queries from the pg_vector docs and translate them to Drizzle

import { l2Distance } from 'drizzle-orm';

// SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;
db.select().from(items).orderBy(l2Distance(items.embedding, [3,1,2]))

// SELECT embedding <-> '[3,1,2]' AS distance FROM items;
db.select({ distance: l2Distance(items.embedding, [3,1,2]) })

// SELECT * FROM items ORDER BY embedding <-> (SELECT embedding FROM items WHERE id = 1) LIMIT 5;
const subquery = db.select({ embedding: items.embedding }).from(items).where(eq(items.id, 1));
db.select().from(items).orderBy(l2Distance(items.embedding, subquery)).limit(5)

// SELECT (embedding <#> '[3,1,2]') * -1 AS inner_product FROM items;
db.select({ innerProduct: sql`(${maxInnerProduct(items.embedding, [3,1,2])}) * -1` }).from(items)

// and more!

🎉 New PostgreSQL types: point, line

You can now use point and line from PostgreSQL Geometric Types

Type point has 2 modes for mappings from the database: tuple and xy.

  • tuple will be accepted for insert and mapped on select to a tuple. So, the database Point(1,2) will be typed as [1,2] with drizzle.

  • xy will be accepted for insert and mapped on select to an object with x, y coordinates. So, the database Point(1,2) will be typed as { x: 1, y: 2 } with drizzle

const items = pgTable('items', {
 point: point('point'),
 pointObj: point('point_xy', { mode: 'xy' }),
});

Type line has 2 modes for mappings from the database: tuple and abc.

  • tuple will be accepted for insert and mapped on select to a tuple. So, the database Line{1,2,3} will be typed as [1,2,3] with drizzle.

  • abc will be accepted for insert and mapped on select to an object with a, b, and c constants from the equation Ax + By + C = 0. So, the database Line{1,2,3} will be typed as { a: 1, b: 2, c: 3 } with drizzle.

const items = pgTable('items', {
 line: line('line'),
 lineObj: point('line_abc', { mode: 'abc' }),
});

🎉 Basic "postgis" extension support

There is no specific code to create an extension inside the Drizzle schema. We assume that if you are using postgis types, indexes, and queries, you have a PostgreSQL database with the postgis extension installed.

geometry type from postgis extension:

const items = pgTable('items', {
  geo: geometry('geo', { type: 'point' }),
  geoObj

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone Europe/Prague, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/samialdury/nodejs-api).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

@renovate renovate bot enabled auto-merge (squash) April 21, 2024 23:28
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 21, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 22, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 22, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 25, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 25, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 25, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 26, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 26, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 26, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Apr 27, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Jun 17, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Jun 18, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Jun 20, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Jun 20, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Jun 21, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Jun 21, 2024
@renovate renovate bot changed the title chore(deps): update all non-major dependencies (minor) fix(deps): update all non-major dependencies (minor) Jun 21, 2024
@renovate renovate bot force-pushed the renovate/all-minor-patch branch from f544dcd to 51245dd Compare June 22, 2024 05:06
renovate-approve[bot]
renovate-approve bot previously approved these changes Jun 22, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Jun 23, 2024
@samialdury samialdury closed this Jun 24, 2024
auto-merge was automatically disabled June 24, 2024 17:57

Pull request was closed

@samialdury samialdury deleted the renovate/all-minor-patch branch June 24, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant