Drizzle Team

DT

Drizzle Team

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

Join

drizzle-kit generate tries to delete all foreign keys

I migrated from prisma to drizzle orm and used drizzle-kit pull to generate my first migration. Now i have the issue that every time i try to change something in the schema drizzle-kit generate generates a migration file which drops every foreign key in the db. I am using mysql with mysql2....

drizzle-kit push command is really slow

Hey everyone! Wanted to know if this is some kind of problem with my setup/schema or is drizzle-kit push just extremely slow? (1 minute+ for 25 tables)...

How to share drizzle schemas in a npm package?

Hi there, how could I share some table schemas from a npm package? I've tried to export the schema.ts in package.json like ```json "exports": {...

Seed refine custom data

Hi, someone know if it exist a way to use drizzle-seed with Refinements to generate a Jsonb in a specific format for exemple ```ts seed(db, {...

enum created using pgEnum is shown as not a function

I have created a like table that has a likeTypesEnum created using pgEnum in a file. I also have created a comment table that uses the exported likeTypesEnum from the like table. I was writing unit tests for the service functions for the like table but I run into the following TypeError when I try to run the unit tests. Error: TypeError: (0 , likeTypesEnum) is not a function ...

[bug]: CompressionStream is not defined

When running drizzle-kit studio via the bun runtime, causes the console to spam with the below error. The github repo link is invalid so sending it here :) Exact command run: ```bash bun run --bun drizzle-kit studio...
No description

Failed query:

I have a function that runs 100k times a day and sometimes i have this error. Failed query: select id, ..... Error: Failed query: select id, fingerprint, landing_id, integration_id, type, reference, organization_id, fbclid, formatted_fbclid, metadata, fingerprint_data, created_at, (...

Issue: INSERT automatically includes ALL schema columns, even when not provided in .values() Drizzle

Issue: INSERT automatically includes ALL schema columns, even when not provided in .values() Drizzle is including columns in INSERT statements that I'm not explicitly providing in .values(). For nullable columns, it automatically sets them to NULL, which causes errors when the column doesn't exist in the database. Example schema ```ts export const users = sqliteTable("users", {...

Testcontainers w/ Neon Proxy

Does anyone know how to set up a 100% local integration tests using 'ghcr.io/timowilhelm/local-neon-http-proxy:main'? While I do have a means of running integration tests without it, I'd like to have it as close to the real thing as possible for my tests so to get reliable test results. However, I seem unable to set it up, and I have no idea what I'm doing wrong....

Issue with sqlite real type and drizzle-zod schema

Versions used: - drizzle-orm 0.44.5 (sqlite-core) - drizzle-zod 0.8.3 - zod 4.1.12 (also tried latest 3.x) ...

Having trouble with drizzle-kit pull -- is there a way to generate schema without relations?

I'm taking a 'database-first' approach. I have an existing Postgresql database with over 150 tables. I'd like to use the generated schema provided by drizzle-kit pull. However, I'm having a couple of issues with this approach - specifically i have a circular reference between two tables (An employee belongs to a department, and a deparmtent has an employee assigned to it as department owner, for example). This causes a TS error in the generated schema. If I delete out the "foreignKey" parts of one of the tables, that resolves it. Does anyone know how to get around this? I don't even need the generated relations since I plan to use the select syntax -- I'd be fine with just generating the models of the tables themselves without relations. I can't find any documentation on drizzle-kit though to generate just the tables...

Custom Types aren't inheriting the schema name but is undefined

I have a working table that is currently being created as my_schema.user but when I try to add a custom type (bytea) then that particular column is setting the schema value to undefined. ```sh query: 'ALTER TABLE "my_schema"."user" ALTER COLUMN "image" SET DATA TYPE "undefined"."bytea";', params: [],...

how to query across relationships

I'm trying to find all events that are hosted in restaurants close to the user, I tried the following: ```const eventos = await this.repositorioEvento.find({ where: gte(ev.fecha, new Date().toISOString().split('T')[0]), with: {...

Is there a way to change migration file name instead of using sequential default pattern?

I've been facing many problems while developing a new project with a large development team using Dreezle ORM, because of these sequential files. Is there a way to change it to timestamps or something similar without breaking the journal and snapshots?

Drizzle Studio not working with Turborepo Monorepo + AlloyDB

Hi Drizzle Team, our company recently adopted drizzle to go alongside our migration from Supabase to AlloyDB and it has been great! We have been using drizzle within our internal db package that is consumed by our downstream apps and it has worked flawlessly. We only run into issues when trying to set up and run drizzle studio. i run the command from the db package itself and then it seems to be working but then we are still not able to view anything in the browswer or elsewhere. What are we doi...

Drizzle Gateway where can I find the license?

Where can I find the license for Drizzle Gateway?

drizzle runtime migrations with svelte production build

Hi! I am using better-auth with drizzle-orm and i am doing the 4th way of handling migrations
I want to have database schema in my TypeScript codebase, I want Drizzle to generate SQL migration files for me and I want Drizzle to apply them during runtime
I want to have database schema in my TypeScript codebase, I want Drizzle to generate SQL migration files for me and I want Drizzle to apply them during runtime
...
No description