Drizzle Team

DT

Drizzle Team

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

Join

Security issue GHSA-67mh-4wv8-2f99

Trying to bring attention to the security advisory listed below which is currently applicable to Drizzle-Kit, though a member of the Drizzle team has yet to respond. The issue is present since October of last year. The security advisory in question: https://github.com/advisories/GHSA-67mh-4wv8-2f99 ...

Drizzle alongside Electron, Vite and Nuxt

Hey! Recently decided to go for Drizzle on my Manga reading app I'm making with electron and nuxtjs (vue framework). However when I compile my code through vite, nuxt-electron and vite-plugin-electron, I get this fatal error: (other message since discord's limit..) ...

Generated Column Unique Constraint

The Drizzle docs on generated columns (https://orm.drizzle.team/docs/generated-columns), for Postgres, say "Cannot directly use in primary keys, foreign keys, or unique constraints" Does this mean that generated columns cannot have unique constraints generated in the SQL? The postgres docs (https://www.postgresql.org/docs/current/ddl-generated-columns.html) are linked, but I don't see any mention about unique constraints being unsupported there. Is this then a limitation of Drizzle, or is it a Postgres limitation after all?...

drizzle-kit push Cloudflare d1 local

How can I develop locally with drizzle and a Cloudflare d1 database. I would preferably want to use drizzle-kit push.

Type Error when Generating Typebox

I'm encountering a type compatibility issue with Drizzle ORM and TypeBox. When using createSchemaFactory from drizzle-typebox with PostgreSQL tables, I'm getting type errors when trying to create schemas. But in Runtime it Works without any Problems, i also Tried to edit my tsconfig to: ```json { "compilerOptions": {...

Deno + libSQL

I need help. I am getting Uncaught (in promise) TypeError: LoadLibraryExW failed (attached screenshot) on running the compiled version (executable) with Using drizzle w/ all permission enabled (-A) Using this on Deno v2.2.8 ...
No description

Unable to resolve "@libsql/client" from "node_modules/drizzle-orm/libsql/driver.js"

I'm getting this error in a react native expo project Although not seeing it when init a new project with https://better-t-stack.pages.dev/new and adding in the same dependency. Not sure if anyone has come across this before...

(drizzle-kit) Unexpected character error

First time using drizzle, I have encountered Unexpected "�" error coming from drizzle.config.ts when running npx drizzle-kit generate (or any other drizzle-kit command). My drizzle.config.ts: ```ts import "dotenv/config"; import { defineConfig } from "drizzle-kit";...

DB Query Logging with Request Context

I'm wanting my DB queries to be logged using structured JSON and including the trace id of the request that caused the query to run. Previously I had a single global drizzle instance that I imported directly in my handlers. In order to support tracing I've added a middleware that add's a drizzle instance per request. Every drizzle instance is initialized with the same postgres.js connection, and my handlers now use c.var.db to access the DB. Is this the expected usage pattern? Are there issues I should expect with having multiple drizzle instances using the same underlying connection?...

Migrations not being applied, despite being marked as complete

Hi, I have a project with multiple migrations that now seems to not actually apply. Starting fresh with a clear database applies them all without any issue, but trying to migrate an existing database seems to just not do anything: ```
db:migrate...

Drizzle config and websocket

See the important callout in the docs here (go to Neon Websockets tab): https://orm.drizzle.team/docs/connect-neon#step-2---initialize-the-driver-and-make-a-query It says to add ws in the drizzle config, but I don't know where. Additonally I opted to use pool with neon. The issue I am having is that my migrations are not being applied correctly and I am wonder if incorrect config is the reason. Here is my drizzle.config.ts...

Query to include parent with child infers types as `never`

Hello, In my schema, I have a self-referential foreign key set up: ```...

Including SQL files in vite bundle to for migration management at runtime

Hello, I'm trying to make myself a little API endpoint to run migrations and rollbacks during runtime. I keep getting stuck on trying to include the directory with migrations in the vite build so that I can pass that directory to the migrate() function. I'm assuming theres a setting in my vite config to do this, but I keep finding links back to this page https://vite.dev/guide/assets.html which is for individual files where as I want an entire directory....

My queries insert/delete are coming back with in error ...

Error inserting user: [Error: This function can now be called only as a tagged-template function: sqlSELECT ${value}, not sql("SELECT $1", [value], options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).] 0.30.6 ``` const u :typeof users.$inferInsert = {...

Error when generating/pushing pgView

Hello, When I try to create a new view, and run the generate or the push command, it errors and tells me that the view is already on the schema. I checked multiple times and its not. I think I am doing something wrong, or maybe its a bug
No description

Xata.io batch queries support?

I was looking though some hosted database options to see what I may want to use and I came across xata (as mentioned in homepage). It looks cool and I see drizzle has support, however is there a reason it doesn't appear to support their batch api? (for context it makes me feel very good on serverless and doing many changes) https://xata.io/docs/api-reference/db/db_branch_name/sql/batch https://orm.drizzle.team/docs/batch-api -# (oh let me know if i'm meant to make gh issue requesting this)...

Drizzle & Supabase

Hello, im using supabase and doing a database first approach. I make my db changes using supabase UI and then i drizzle-kit pull to generate the ts files. right now doing the command its making ```ts...

drizzle-kit pull: Custom GelDB Type issue; Unable to use non-default Gel module

Gihub issue: https://github.com/drizzle-team/drizzle-orm/issues/4404 Minmal repo: https://github.com/xerullian/drizzle-gel-enum 1. drizzle-kit pull fails with a TypeError when any Gel schema contains a custom-defined enum. 2. drizzle-kit pull succeeds, but creates 0 schema when types are defined within a non-default module (e.g., module foo {})....

Correct Client type to pass drizzle client around

Hey community, I love drizzle but sometimes I find it quite challenging to deal with the types. I am not sure if this problem is a skill issue, thus I wanna ask you guys. Let me explain: I am using Nest.js and I have DatabaseService file that create the drizzle client internally and exposes it. I want this service to be dynamic which means I want to be able to pass the schema to it and the type of the client should be infered automagically. But I am struggling to properly type it: This is the relevant definitions of my types in the DatabaseService regarding the drizzle client:...

seed expected prop db type doesn't match what drizzle provides on created db object

Hi! At start - thanks for drizzle and drizzle-seed! I would love to get some help, it shows types issues on db that i put into seed or reset functions. ...
No description