Drizzle Team

DT

Drizzle Team

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

Join

Clear the whole database?

For my test environment I'd like to clear the whole db.. is there a way to achieve this using drizzle ?

generate:pg "snapshot.json data is malformed" error after merge conflicts

Hi there, my team and I use the following method to avoid merge issues: If master has migrations that you are missing, drop all your new migrations, merge in the master, then run generate:pg to re-generate your migrations. Based on my understanding of drizzle-kit, this should work, but generate:pg is consistently failing with the above error after I drop my new migrations then merge in my team's. Anyone run into this before? Is there any way to get more info on what the issue with the snapshot is?...

Importing drizzle-zod Schemas on the Client

Hi, Is it ok to import schemas generated with drizzle-zod via createInsertSchema on the client? I have my schema in a separate schema.ts file away from where I init my database if that matters at all. Thanks!...

Updating jsonb objects with Drizzle?

Hey there, i'm currently working on migrating my database and code from MongoDB with Mongoose to Postgres with Drizzle and have encountered a question that I couldnt find answered on the docs. I query JSON like this in my MongoDB database ```ts Profiles.findOneAndUpdate({ accountId: user.accountId }, { $set: { "profiles.athena.items": allItems.items } }, { new: true }, (err, doc) => { if (err) console.log(err);...

auto updated_at

is there a way to automatically update the updatedAt column of a postgres table ?

Fulltext index MySQL

How can I define a fulltext index with MySQL? there is no fulltextIndex available in mysql-core.

You're about to add not-null version without default value

I added this column
version: int("version").notNull().default(0),
version: int("version").notNull().default(0),
and it's trying to truncate because it thinks there's on default value...

Cannot read properties of undefined (reading 'columns')

``` /home/thdxr/dev/projects/bumi/bumi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs:11810 result[key].columns[value[0]].primaryKey = true; ^ ...

neon coldstarts in vercel edge

hey!! if my neondb is in idle state, and i try to query something -- it will error out. - error node_modules/@neondatabase/serverless/index.js (1527:67) @ eval - error error connecting to server: Connection refused (os error 111) `Caused by:...

Module '"drizzle-orm/mysql-core"' has no exported member 'unique'.ts(2305)

Getting this error when trying to import unique ```typescript import { text, unique, // erroring out...

Is there a way to set the index operator type for postgres?

I'm migrating our project to drizzle, and I want to add the indexes to the table. Previously we were using Sequelize and we had an index on a jsonb field with jsonb_path_ops operator. Is there a way to do the same in drizzle?...

How to update multiple rows with one query?

Take this array as an example: ```ts const data = [ {id: 1, col1: "col1 data where id = 1"} {id: 2, col1: "col1 data where id = 2"}...

Use Drizzle in NestJS app

Hi everyone ! I am new to both drizzle and NestJS and was wondering if there was any recipe out there to use Drizzle in NestJS (I couldn't find anything) should I create a service or something ? (as Prisma ?)...

[Solved] Transforming const to the configured target environment ("es5") is not supported yet

So I had a old project, and I copied the DATABASE_URL and on created a basic drizzle project and drizzle.config.ts I got a schema created. Now, I copied the schema.ts file and pasted it into my new (second/another) project. I ran npx drizzle-kit generate:pg but I got the error Transforming const to the configured target environment ("es5") is not supported yet 55 times (55 is the number of tables that I have) 🥹 PLS HELP...

Placeholders in inserting: db.insert().values(placeholder('example'))

Hey, how do I add placeholders inside the values of an insert prepare statement? I get an typeerror when I do so.

Can I add a Unique constraint to a column?

I couldn't find an option for that in the docs. I'm assuming Drizzle doesn't support that. So, could I just edit one of the migration SQL files myself and add the UNIQUE constraint to it? Or would that break things?...