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 check doesn't do anything

Either the documentation is severely misleading or this function is broken because drizzle-kit check only ever returns that "Everything's fine". I've changed schemas without updating migrations, deleted entire migration files, no matter what I do the command will never say anything other than everything's fine. I'm passing in a drizzle config file with a dialect specificed fwiw.

Hi, running into an issue in Drizzle Studio that I think might be related to schema inference or mis

👋 Hey team running into an issue in Drizzle Studio that I think might be related to schema inference or missing relational metadata. Error ID: 5ff9d1f25b504f2f840a72c3cfdda507 There is not enough information to infer relation "public.events.agenda" ...
No description

Trying to connect to QuestDb with Postgres driver

I'm trying to use drizzle for a connection to a QuestDb instance. Their examples are using pg lib for making requests so it should be compatible, but the problem seems to be that drizzle-kit is trying to query non-existent postgres tables. Any workarounds I can do to get it working? ``` // drizzle-kit studio error: table does not exist [table=pg_tablespace]...

Adding a new column

It has been awhile since I have touched my supabase DB 😅 😭 . I have a table ```ts export const voterBallots = pgTable('voter_ballot', { id: serial('id').primaryKey(),...

Transaction help

Hi, we've been using neon serverless with drizzle driver (@neondatabase/serverless & drizzle-orm/neon-http ) successfully for a while. I wanted to know if drizzle has syntax which supports this "non-iteractive" style of transaction mentioned here in neons serverless docs. https://github.com/neondatabase/serverless?tab=readme-ov-file#transaction ```typescript import { neon } from '@neondatabase/serverless'; const sql = neon(process.env.DATABASE_URL);...

Using Entra ID for authenticating in drizzle.config.ts

Attempting to use best practices and use the service principal in our Azure to authenticate to postgres, however i cannot do awaits inside the drizzle.config.ts so i cannot retrieve the token when running drizzle-kit push ```ts import { defineConfig, type Config } from 'drizzle-kit'; if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');...

Turborepo - no type safety when using drizzle in other modules

Hi all, I am setting up a monorepo with turborepo where I have an API under apps/api and a database module under packages/db. I am losing type safety when importing the db instance in another package. I export all of my tables and the drizzle instance like so below: ```ts // packages/db/src/index.ts import "@dotenvx/dotenvx";...
No description

Am i supposed to add the drizzle folder to .gitignore?

I'm talking about the migrations and meta files. I don't need to commit those do I?

Code review, building a generic DAO for DB ops

Hi all, for my SvelteKit application I was building a generic DAO for common CRUD operations as below ```ts import * as schema from "$lib/server/db/schemas/index"; import { eq } from "drizzle-orm"; import type { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";...

drizzle-kit drop

Just upgraded drizzle-kit for the first time in a while and I see that the updated docs no longer have the drop command. Whats the new recommended way to drop old migration files?

No grammar type for text(256)

Error Id : 0f4f0ae177e74113bf9c5de99f01c27f Error: No grammar type for text(256) at qFl (https://local.drizzle.studio/index.js:1287:15226)...

Error: No grammar type for TIMESTAMP – Error ID 4fa91e577c064e1f803c7fcc3ff4b881

Hi team, I'm encountering an issue when using Drizzle Studio. I received the following error message: Unexpected error happened 😕 Error ID: 4fa91e577c064e1f803c7fcc3ff4b881...
No description

Is is possible to use pgSchema with pgTableCreator

I want to use pgSchema and pgTableCreator together to have the tables in a specified schema in postgres and also have prefix for each table. Is there a way to do it?

I can't get the correct typing

Hello, I am new to drizzle and I am in a situation that I don't know how to solve, I would appreciate your help. In this case I have the table of “users” and “account” in this case I want to return the user with its relation which is ‘account’ but it does not return the correct typing for the “account” part. As you can see it says “never”, I don't know what the problem could be. I export correctly the table with its relations on both sides
No description

Cannot find package 'bun' imported from F:\code\RELAND\node_modules\drizzle-orm\bun-sql\driver.js

Could not get to work using bun postgres in drizzle: https://orm.drizzle.team/docs/connect-bun-sql I am using Tanstack Start with bun runtime on Vite...

How do I stop Drizzle from trying to instantiate a connection during build time (next.js)?

Hey everyone, I've a question I can't seem to solve myself right now. I'm using next.js with tRPC and Drizzle (t3 stack, https://github.com/t3-oss/create-t3-app). I'm currently setting up my Docker configuration. I did not intend to pass the env var holding the database url to my docker builder container. As a result, Drizzle is throwing an error because it is trying to instantiate a database connection as soon as createClient is invoked, even though nothing is trying to access the database. How can I work around this? With Prisma this was not an issue, because Prisma only connects to the database if you actually call $connect / upon the first query ran....

Drizzle hides DB errors, shows just "failed query"

Drizzle doesn't show anymore errors. Any way to get them back?
No description

getting a typescript error when trying to use drizzle.mock()

I'm trying to mock my drizzle driver for some unit tests. I'm using drizzle.mock(). When I pass it into the function that takes it, I get the following error: ```Argument of type NodePgDatabase<Record<string, never>> & { $client: "$client is not available on drizzle.mock()";...

How to hide notice logs because of identifier trucation?

Hi there, i am getting constant logs from drizzle/postgres like these: ```{ severity_local: 'NOTICE', severity: 'NOTICE',...