Drizzle Team

DT

Drizzle Team

The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!

Join

Attention for Issue: Dependency to deprecated package @esbuild-kit/esm-loader

Given that there are currently vulnerabilities being reported in the terminal when running npm audit, as well as an advisory that was published here https://github.com/advisories/GHSA-67mh-4wv8-2f99 it is quite odd to notice that this issue has been unnoticed or so it seems by the Drizzle Team. Making me wonder about the current way dependencies and especially vulnerabilities inside these dependencies are being managed. The issue as mentioned in the title, as well as a pull-request that already addresses the issue can be found here. Issue: https://github.com/drizzle-team/drizzle-orm/issues/3067 PR: https://github.com/drizzle-team/drizzle-orm/pull/4250...

Monorepo drizzle-zod types problem

I have a monorepo with packages like drizzle-schema and api-contracts
No description

error when running kit's introspect or studio

Hello! When running stuff from drizzle kit i get internal import errors ``` Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './gel-core' is not defined by "exports" ...

Getting typescript error when using where clause inside with in query API.

Hi, I need help in resolving the below mentioned typescript error
ts: Object literal may only specify known properties, and 'where' does not exist in type
ts: Object literal may only specify known properties, and 'where' does not exist in type
on where clause inside assessment of this query ```js...

TS2345: PgTableWithColumns<…> from buildable shared-lib not assignable to PgTable<TableConfig>

I’m working in an Nx monorepo with a shared-lib and a Node.js API. Both use Drizzle-ORM (same version), but my API imports tables from the shared-lib. When I try to join one of those tables, TypeScript complains about a type mismatch. ```bash error TS2345: Argument of type 'PgTableWithColumns<...>' ...

Drizzle-Zod

"zod": "^3.25.36" "drizzle-zod": "^0.8.2", Previously I was able to re-use schema. ```...
No description

Type error when using `drizzle-zod` with sqlite table schema

I'm trying to do this:
const a = createSelectSchema(schema.deckInfo)
const a = createSelectSchema(schema.deckInfo)
...

Correct setting for PostgreSQL timestamp storing UTC value

Hey all, I've read the following but want to check - is the ..defaultNow() method going to return localised now or UTC? https://orm.drizzle.team/docs/guides/timestamp-default-value#postgresql...

Incredibly cryptic error when running DB transaction

I have this piece of code: ```ts const [newSolution] = await db.transaction(async (tx) => { await tx.update(csTable).set({ state: "archived" }).where(eq(csTable.state, "solved")); return await tx.insert(csTable).values([newCollectiveSolution]).returning(collectiveSolutionsPublicCols);...

Generics wrappers

Hi, I'm trying to have some wrapper on top of drizzle select in postgres dialect. My function looks as follow: ```ts const find = <T extends PgTable>(table: T) { return db.select().from(this.table);...

Monorepo sharing schema problem

I have turborepo where I have two packages -> drizzle-schema and api-contracts so I try to import some table definitions from drizzle-schema module to api-contracts, which have drizzle-zod installed to generate zod schemas but when I import table definitions from drizzle-schema, and pass them to drizzle-zod functions, I get I type errors...
No description

Could not dynamically require "@libsql/win32-x64-msvc"

Full error: ``` Error: Could not dynamically require "@libsql/win32-x64-msvc". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work. at commonjsRequire (C:\Repos\poker-game-manager.vite\build\main.js:29500:9) ......

Types across processes without db definitions in shared code (Electron)

I have the db schema definitions and things like insert schemas and all that defined in the main code but I'd very much like to have the insert, select schemas and in general type definitions from them available in renderer too - but don't know how to do it without putting the code in a shared folder but that seems bad since I might accidentally have that code run in the renderer process which is not good? Something like that.

Using one drizzle connection per request (Cloudflare + postgres)

When connecting to Drizzle postgres (Neon) through a cloudflare worker. I always get this error on first load.
Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance.
Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance.
...

why doesn't `onConflictDoUpdate` allow strings as targets?

Can't do this... ```ts await db .insert(schema.users) .values({...

`findFirst` returns `Record<Key, undefined>` instead of `undefined` for empty result sets

Hi! For queries with no results, I'm expecting to get undefined, as the docs state. However, the return value is an object with all columns/props set to undefined. I use sqlocal as a SQLite driver. Is this something the driver could be responsible for? Any guidance on where to start looking?...

How to use JSON_TABLE with drizzle?

I'm trying to use JSON_TABLE that was added to Postgres 17, but I can't figure out who to make drizzle work with it.

How to do a leftJoin on a pgArray of uuid?

```ts export const Messages = pgTable("messages", { id: uuid("id").defaultRandom().primaryKey(), text: text("text").notNull(), media: uuid("media_id")...

Is there a way to make Drizzle work with Tauri?

I would love to have type safety in Tauri in my app but I didn't find about it... https://github.com/manga-you-know/desktop this is my app btw...