Skip to content

Bump drizzle-orm from 0.27.2 to 0.28.0#3

Closed
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/drizzle-orm-0.28.0
Closed

Bump drizzle-orm from 0.27.2 to 0.28.0#3
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/drizzle-orm-0.28.0

Conversation

@dependabot
Copy link

@dependabot dependabot bot commented on behalf of github Aug 7, 2023

Bumps drizzle-orm from 0.27.2 to 0.28.0.

Release notes

Sourced from drizzle-orm's releases.

0.28.0

Breaking changes

Removed support for filtering by nested relations

Current example won't work in 0.28.0:

const usersWithPosts = await db.query.users.findMany({
  where: (table, { sql }) => (sql`json_array_length(${table.posts}) > 0`),
  with: {
    posts: true,
  },
});

The table object in the where callback won't have fields from with and extras. We removed them to be able to build more efficient relational queries, which improved row reads and performance.

If you have used those fields in the where callback before, there are several workarounds:

  1. Applying those filters manually on the code level after the rows are fetched;
  2. Using the core API.

Added Relational Queries mode config for mysql2 driver

Drizzle relational queries always generate exactly one SQL statement to run on the database and it has certain caveats. To have best in class support for every database out there we've introduced modes.

Drizzle relational queries use lateral joins of subqueries under the hood and for now PlanetScale does not support them.

When using mysql2 driver with regular MySQL database - you should specify mode: "default". When using mysql2 driver with PlanetScale - you need to specify mode: "planetscale".

import { drizzle } from 'drizzle-orm/mysql2';
import mysql from 'mysql2/promise';
import * as schema from './schema';
const connection = await mysql.createConnection({
uri: process.env.PLANETSCALE_DATABASE_URL,
});
const db = drizzle(connection, { schema, mode: 'planetscale' });

Improved IntelliSense performance for large schemas

We've run the diagnostics on a database schema with 85 tables, 666 columns, 26 enums, 172 indexes and 133 foreign keys. We've optimized internal types which resulted in 430% speed up in IntelliSense.

Improved Relational Queries Permormance and Read Usage

... (truncated)

Commits
  • f1c6b48 Merge pull request #982 from drizzle-team/beta
  • ddb1408 Merge branch 'main' into beta
  • aae371a Merge pull request #981 from drizzle-team:improve-types-performance
  • 5dd9190 Fix test
  • 1c3d914 Change Node version to 18
  • 569ea0f Merge branch 'beta' into improve-types-performance
  • 4e264be Rename mysql mode config key, add changelog
  • 4768d12 Add type performance improvements
  • cd1b6be Merge pull request #979 from drizzle-team/empty-inserts
  • 2a86a33 Add possibility to insert empty values objects in sqlite and postgres dialects
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [drizzle-orm](https://github.com/drizzle-team/drizzle-orm) from 0.27.2 to 0.28.0.
- [Release notes](https://github.com/drizzle-team/drizzle-orm/releases)
- [Commits](drizzle-team/drizzle-orm@0.27.2...0.28.0)

---
updated-dependencies:
- dependency-name: drizzle-orm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Aug 7, 2023
@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Aug 14, 2023

Superseded by #5.

@dependabot dependabot bot closed this Aug 14, 2023
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/drizzle-orm-0.28.0 branch August 14, 2023 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants