Drizzle Team

DT

Drizzle Team

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

Join

Depreciated table

Hi everyone, pgTable is marked here as depreciated but I can't understand why : ```ts export const clinicsSessions = pgTable( 'clinicsSessions', {...

Does eslint-plugin-drizzle work with the new eslint.config.js and eslint 9?

I could only find docs about the legacy eslint config format

Drizzle better-sqlite3 WAL mode

Hello! Sorry if this was asked before but I couldn’t find a way to do it by searching. How should you enable WAL mode with drizzle? Is it enough to put it inside a migration file, or you need to somehow execute it when you connect...

Drizzle-Zod not supported in latest version of Drizzle-ORM

I tried upgrading to drizzle orm 0.36, but I was having problems similar to this github issue. I downgraded back and everything is working fine. Has anybody been having this issue? https://github.com/drizzle-team/drizzle-orm/issues/3125...

Unique Constraint

I'm slightly confused as to why my unique constraint doesn't work as expected. I have the following schema: `export const userPermissionsTable = pgTable(...
No description

Foreign Key, is this method deprecated?

facing a lot of problems using this syntax, somebody can help me? `import { foreignKey, index,...

An example from the docs is marked as deprecated.

Hello, I'm using postgres and my pgTable calls are being shown as "deprecated", as well as the example in the docs. ```ts const table = pgTable('table', { id: integer('id'),...

Can I re-use my Prisma Migrations on Drizzle?

I'm migrating a project from Prisma to Drizzle, I already have a migrations folder with some migrations there. Can I have Drizzle port/convert those migrations to itself?

Is there a type for a Drizzle connection?

My use case is the following: I'm building a library dealing with a Neon database, but the connection shoud be created by the app using the library. So, all the functions of the lib expects as a their first parameter the actual connection to the database. How can I type this parameter so that the function accepts both a connection created with the Neon HTTP and Websockets drivers? Neon HTTP driver ```typescript...

composite primary key approach shows deprecate

Hi, if I follow this approach: https://orm.drizzle.team/docs/indexes-constraints#composite-primary-key to create a primary key. I get a depecrated notification....

Conditional batch on Neon Batch API?

Hi, it's possible to do something like: ```typescript const deleteImages = true // can be true or false await db.batch([...

Setting up drizzle.config.ts for AWS

For the life of me, I cannot figure this out. ```ts import { defineConfig } from "drizzle-kit" export default defineConfig({...

Help Setting up Driver w/ AWS RDS

I'm following the instructions here directly https://orm.drizzle.team/docs/connect-aws-data-api-pg But, this instance of drizzle is unfound....
Solution:
The documentation is incorrect, it should be import { drizzle } from "drizzle-orm/aws-data-api/pg"
No description

typeof table.$inferInsert isn't returning all properties?

I upgraded from .31.2 to .36 today, and now I'm getting type errors. I think this image explains it best, but what I have is a calendar schema. I have a NewCalendar type but as you can see it is only picking up the user_id and nothing else. This means that any insert/update I'm trying to do it failing because I'd be trying to set summary, for example, and it isn't on the type. I looked through the release notes and didn't see anything about this. Any ideas?...
No description

A way to make a custom type generatedAlwaysAsIdentity

I've tried the following ways to achive this, but none of them work.
id: customId("id").primaryKey().generatedAlwaysAs(sql`IDENTITY`)
id: customId("id").primaryKey().generatedAlwaysAs(sql`IDENTITY`)
...

RLS - Typesafety

I noticed in the docs the created RLS client doesn't have your schema passed to it, meaning you wouldn't be able to use dbClient.query - docs here: https://orm.drizzle.team/docs/rls Is there a reason for this? In my testing, if you pass the same Database type your usual client returns, you get full functionality. This might just be a docs miss, but want to be sure in case this was done this way for a reason!...

drizzle-kit push keeps trying to drop and recreate the same constraints

``` │ALTER TABLE "authenticator" DROP CONSTRAINT authenticator_userId_credentialID_pk; │--> statement-breakpoint │ALTER TABLE "authenticator" ADD CONSTRAINT authenticator_userId_credentialID_pk PRIMARY KEY(userId,credentialID); │ALTER TABLE "account" DROP CONSTRAINT account_provider_providerAccountId_userId_pk;...

Using Zod objects generated from drizzle zod with ts-rest . Parameters interpreted as optional

Hey I am trying to use drizzle zod to generate zod objects to be used in my ts rest contract. however when I try to use this contract in my handlers the fields in the body being passed are interpreted as being optional and not mandatory contract ```...