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

[Snyk] Upgrade drizzle-orm from 0.29.5 to 0.30.10 #24

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

Conversation

YuraGB
Copy link
Owner

@YuraGB YuraGB commented Jun 14, 2024

This PR was automatically created by Snyk using the credentials of a real user.


![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)

Snyk has created this PR to upgrade drizzle-orm from 0.29.5 to 0.30.10.

ℹ️ 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 62 versions ahead of your current version.

  • The recommended version was released on a month ago.

Release notes
Package name: drizzle-orm
  • 0.30.10 - 2024-05-01

    New Features

    🎉 .if() function added to all WHERE expressions

    Select all users after cursors if a cursor value was provided

    async function someFunction(categories: string[] = [], views = 0) {
      await db
        .select()
        .from(users)
        .where(
           and(
              gt(posts.views, views).if(views > 100),
              inArray(posts.category, categories).if(categories.length > 0),
           ),
        );
    }

    Bug Fixes

    • Fixed internal mappings for sessions .all, .values, .execute functions in AWS DataAPI
  • 0.30.10-9929654 - 2024-05-01
  • 0.30.9 - 2024-04-21
    • 🐛 Fixed migrator in AWS Data API
    • Added setWhere and targetWhere fields to .onConflictDoUpdate() config in SQLite instead of single where field
    • 🛠️ Added schema information to Drizzle instances via db._.fullSchema
  • 0.30.9-fc4ded5 - 2024-05-16
  • 0.30.9-f9be0ab - 2024-05-01
  • 0.30.9-d939ec2 - 2024-04-21
  • 0.30.9-b473fa9 - 2024-05-21
  • 0.30.9-a420907 - 2024-05-10
  • 0.30.9-88f271b - 2024-05-21
  • 0.30.9-8680b6d - 2024-04-26
  • 0.30.9-825932f - 2024-04-26
  • 0.30.9-68815d1 - 2024-04-29
  • 0.30.9-33a34e3 - 2024-05-21
  • 0.30.9-30dc2ee - 2024-04-30
  • 0.30.9-14c6fe3 - 2024-05-15
  • 0.30.9-0a473f4 - 2024-04-30
  • 0.30.8 - 2024-04-11
    • 🎉 Added custom schema support to enums in Postgres (fixes #669 via #2048):

    ⚠️ Only available in drizzle-orm for now, drizzle-kit support will arrive soon

    import { pgSchema } from 'drizzle-orm/pg-core';

    const mySchema = pgSchema('mySchema');
    const colors = mySchema.enum('colors', ['red', 'green', 'blue']);

    • 🎉 Changed D1 migrate() function to use batch API (#2137)
    • 🐛 Split where clause in Postgres .onConflictDoUpdate method into setWhere and targetWhere clauses, to support both where cases in on conflict ... clause (fixes #1628, #1302 via #2056)
    • 🐛 Fixed query generation for where clause in Postgres .onConflictDoNothing method, as it was placed in a wrong spot (fixes #1628 via #2056)
    • 🐛 Fixed multiple issues with AWS Data API driver (fixes #1931, #1932, #1934, #1936 via #2119)
    • 🐛 Fix inserting and updating array values in AWS Data API (fixes #1912 via #1911)

    Thanks @ hugo082 and @ livingforjesus!

  • 0.30.8-a1accd7 - 2024-04-16
  • 0.30.8-3d06cf2 - 2024-04-20
  • 0.30.8-1a48cee - 2024-04-10
  • 0.30.8-4428354 - 2024-04-16
  • 0.30.7 - 2024-04-03

    Bug fixes

    • Add mappings for @ vercel/postgres package
    • Fix interval mapping for neon drivers - #1542
  • 0.30.7-df2bd77 - 2024-04-06
  • 0.30.7-ddf43d6 - 2024-04-03
  • 0.30.7-be05767 - 2024-04-09
  • 0.30.7-bb0f096 - 2024-04-03
  • 0.30.7-a7c90b8 - 2024-04-07
  • 0.30.7-9b8a94f - 2024-04-07
  • 0.30.7-94e7af5 - 2024-04-04
  • 0.30.7-59f2958 - 2024-04-10
  • 0.30.7-400d69e - 2024-04-08
  • 0.30.7-2c9b73b - 2024-04-09
  • 0.30.7-9185563 - 2024-04-10
  • 0.30.6 - 2024-03-28

    New Features

    🎉 PGlite driver Support

    PGlite is a WASM Postgres build packaged into a TypeScript client library that enables you to run Postgres in the browser, Node.js and Bun, with no need to install any other dependencies. It is only 2.6mb gzipped.

    It can be used as an ephemeral in-memory database, or with persistence either to the file system (Node/Bun) or indexedDB (Browser).

    Unlike previous "Postgres in the browser" projects, PGlite does not use a Linux virtual machine - it is simply Postgres in WASM.

    Usage Example

    import { PGlite } from '@ electric-sql/pglite';
    import { drizzle } from 'drizzle-orm/pglite';

    // In-memory Postgres
    const client = new PGlite();
    const db = drizzle(client);

    await db.select().from(users);


    There are currently 2 limitations, that should be fixed on Pglite side:

  • 0.30.6-dfa923a - 2024-03-28
  • 0.30.6-d5cc3ce - 2024-03-29
  • 0.30.6-cb0c553 - 2024-04-02
  • 0.30.6-169dab4 - 2024-04-01
  • 0.30.5 - 2024-03-27

    New Features

    🎉 $onUpdate functionality for PostgreSQL, MySQL and SQLite

    Adds a dynamic update value to the column.
    The function will be called when the row is updated, and the returned value will be used as the column value if none is provided.
    If no default (or $defaultFn) value is provided, the function will be called when the row is inserted as well, and the returned value will be used as the column value.

    Note: This value does not affect the drizzle-kit behavior, it is only used at runtime in drizzle-orm.

    const usersOnUpdate = pgTable('users_on_update', {
      id: serial('id').primaryKey(),
      name: text('name').notNull(),
      updateCounter: integer('update_counter').default(sql`1`).$onUpdateFn(() => sql`update_counter + 1`),
      updatedAt: timestamp('updated_at', { mode: 'date', precision: 3 }).$onUpdate(() => new Date()),
      alwaysNull: text('always_null').$type<string | null>().$onUpdate(() => null),
    });

    Fixes

    • [BUG]: insertions on columns with the smallserial datatype are not optional - #1848

    Thanks @ Angelelz and @ gabrielDonnantuoni!

  • 0.30.5-bb96a77 - 2024-03-22
  • 0.30.5-ab9feb7 - 2024-03-25
  • 0.30.5-9e6a6ee - 2024-03-20
  • 0.30.5-35c8b2b - 2024-03-22
  • 0.30.5-139135c - 2024-03-20
  • 0.30.4 - 2024-03-19
  • 0.30.3 - 2024-03-18
  • 0.30.3-bf39e45 - 2024-03-18
  • 0.30.3-788f251 - 2024-03-18
  • 0.30.3-722a662 - 2024-03-18
  • 0.30.2 - 2024-03-14
  • 0.30.2-e4bc89e - 2024-03-18
  • 0.30.2-be1fd1a - 2024-03-16
  • 0.30.2-34d3108 - 2024-03-18
  • 0.30.2-29e6b46 - 2024-03-14
  • 0.30.1 - 2024-03-08
  • 0.30.1-e14d6ca - 2024-03-14
  • 0.30.1-e01313e - 2024-03-11
  • 0.30.1-d9db4a3 - 2024-03-08
  • 0.30.1-bfc757f - 2024-03-11
  • 0.30.1-97e97e1 - 2024-03-12
  • 0.30.0 - 2024-03-07
  • 0.30.0-373aad0 - 2024-03-08
  • 0.29.5 - 2024-03-06
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.29.5 to 0.30.10.

See this package in npm:
drizzle-orm

See this project in Snyk:
https://app.snyk.io/org/yuhur1985/project/6e3ee64f-b715-4f5a-a9d7-31112b2e198c?utm_source=github&utm_medium=referral&page=upgrade-pr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants