Skip to content

[Snyk] Upgrade drizzle-orm from 0.43.1 to 0.44.2#159

Closed
A222moq3e wants to merge 1 commit into
devfrom
snyk-upgrade-fb257a3fa7950fda1457950773565001
Closed

[Snyk] Upgrade drizzle-orm from 0.43.1 to 0.44.2#159
A222moq3e wants to merge 1 commit into
devfrom
snyk-upgrade-fb257a3fa7950fda1457950773565001

Conversation

@A222moq3e

Copy link
Copy Markdown
Collaborator

snyk-top-banner

Snyk has created this PR to upgrade drizzle-orm from 0.43.1 to 0.44.2.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 10 versions ahead of your current version.

  • The recommended version was released 21 days ago.

Release notes
Package name: drizzle-orm
  • 0.44.2 - 2025-06-04
    • [BUG]: Fixed type issues with joins with certain variations of tsconfig: #4535, #4457
  • 0.44.2-b5a9650 - 2025-06-18
  • 0.44.2-ab4d983 - 2025-06-17
  • 0.44.2-a2a1a62 - 2025-06-20
  • 0.44.2-8bf5193 - 2025-06-03
  • 0.44.2-6baabce - 2025-06-20
  • 0.44.2-512acc4 - 2025-06-12
  • 0.44.1 - 2025-05-30
  • 0.44.0 - 2025-05-28

    Error handling

    Starting from this version, we’ve introduced a new DrizzleQueryError that wraps all errors from database drivers and provides a set of useful information:

    1. A proper stack trace to identify which exact Drizzle query failed
    2. The generated SQL string and its parameters
    3. The original stack trace from the driver that caused the DrizzleQueryError

    Drizzle cache module

    Drizzle sends every query straight to your database by default. There are no hidden actions, no automatic caching or invalidation - you’ll always see exactly what runs. If you want caching, you must opt in.

    By default, Drizzle uses a explicit caching strategy (i.e. global: false), so nothing is ever cached unless you ask. This prevents surprises or hidden performance traps in your application. Alternatively, you can flip on all caching (global: true) so that every select will look in cache first.

    Out first native integration was built together with Upstash team and let you natively use upstash as a cache for your drizzle queries

    import { upstashCache } from "drizzle-orm/cache/upstash";
    import { drizzle } from "drizzle-orm/...";

    const db = drizzle(process.env.DB_URL!, {
    cache: upstashCache({
    // 👇 Redis credentials (optional — can also be pulled from env vars)
    url: '<UPSTASH_URL>',
    token: '<UPSTASH_TOKEN>',
    // 👇 Enable caching for all queries by default (optional)
    global: true,
    // 👇 Default cache behavior (optional)
    config: { ex: 60 }
    })
    });

    You can also implement your own cache, as Drizzle exposes all the necessary APIs, such as get, put, mutate, etc.
    You can find full implementation details on the website

    import Keyv from "keyv";
    export class TestGlobalCache extends Cache {
      private globalTtl: number = 1000;
      // This object will be used to store which query keys were used
      // for a specific table, so we can later use it for invalidation.
      private usedTablesPerKey: Record<string, string[]> = {};
      constructor(private kv: Keyv = new Keyv()) {
        super();
      }
      // For the strategy, we have two options:
      // - 'explicit': The cache is used only when .$withCache() is added to a query.
      // - 'all': All queries are cached globally.
      // The default behavior is 'explicit'.
      override strategy(): "explicit" | "all" {
        return "all";
      }
      // This function accepts query and parameters that cached into key param,
      // allowing you to retrieve response values for this query from the cache.
      override async get(key: string): Promise<any[] | undefined> {
        ...
      }
      // This function accepts several options to define how cached data will be stored:
      // - 'key': A hashed query and parameters.
      // - 'response': An array of values returned by Drizzle from the database.
      // - 'tables': An array of tables involved in the select queries. This information is needed for cache invalidation.
      //
      // For example, if a query uses the "users" and "posts" tables, you can store this information. Later, when the app executes
      // any mutation statements on these tables, you can remove the corresponding key from the cache.
      // If you're okay with eventual consistency for your queries, you can skip this option.
      override async put(
        key: string,
        response: any,
        tables: string[],
        config?: CacheConfig,
      ): Promise<void> {
        ...
      }
      // This function is called when insert, update, or delete statements are executed.
      // You can either skip this step or invalidate queries that used the affected tables.
      //
      // The function receives an object with two keys:
      // - 'tags': Used for queries labeled with a specific tag, allowing you to invalidate by that tag.
      // - 'tables': The actual tables affected by the insert, update, or delete statements,
      //   helping you track which tables have changed since the last cache update.
      override async onMutate(params: {
        tags: string | string[];
        tables: string | string[] | Table<any> | Table<any>[];
      }): Promise<void> {
        ...
      }
    }

    For more usage example you can check our docs

  • 0.44.0-a42461b - 2025-05-28
  • 0.43.1 - 2025-04-25

    Fixes

from drizzle-orm GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade drizzle-orm from 0.43.1 to 0.44.2.

See this package in npm:
drizzle-orm

See this project in Snyk:
https://app.snyk.io/org/abo3skr2019/project/b4b04c7e-d5c1-4541-84a5-85eb98820e5a?utm_source=github&utm_medium=referral&page=upgrade-pr
@coderabbitai

coderabbitai Bot commented Jun 25, 2025

Copy link
Copy Markdown

Important

Review skipped

Ignore keyword(s) in the title.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@AFAskar AFAskar closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants