Drizzle Team

DT

Drizzle Team

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

Join

Is it okay to manually edit migration files?

I recently had a migration file execute commands for dropping a table in the wrong order. Can I reorder them manually? This wouldn't result in any schema changes technically....

Can't apply migration?

The following migration file was generated by Drizzle-Kit ```SQL DROP TABLE "worker_pay_period";--> statement-breakpoint ALTER TABLE "pay_stub" DROP CONSTRAINT "pay_stub_pay_period_id_worker_pay_period_id_fk";...

Drizzle-kit SSL Error

I've just updated my drizzle-kit to newer version and I'm getting: ``` $ bun run --cwd packages/db push $ drizzle-kit push drizzle-kit: v0.22.1...

Push doesn't work

Yesterday I defined an npm command "db:push": "npx drizzle-kit push --config=drizzle.config.ts" and it worked perfectly. But today when I execute that command again with changes in schema.ts file, it just show the loading state but no response. I am using Supabase as a backend
No description

Lots of type issues after running introspection.

Decided to finally give Drizzle a spin and run introspection on my database to automatically generate the models. But I got loads of type errors that say "Argument of type 'string' is not assignable to parameter of type 'number | SQL<unknown>'.ts(2345)" And this is because of lines like this: version: int("version").default('NULL') How should I fix these & why did this happen in the first place?...

drizzle with AdonisJS

Hello. Has anyone managed to implement drizzle with the AdonisJS framework? If so, how did you handle the migrations? I've been trying for a while but can't wrap my head around how to manage.

Trying to figure drizzle & Supabase out

Hi everyone, I’m new to working with DBs and ORMs, so please bear with me on this. I’m building a part of my website that allows voters to submit a ballot of their top 25 college football teams every week. Everything will be added up and a final top 25 will be comprised of all the votes for that week. I’m basically looking to create https://www.espn.com/college-football/rankings/_/poll/20/week/1/year/2023/seasontype/3 I’m using Drizzle, Supabase, Clerk, Next.js, and Sanity (where articles and the actual teams that can be voted on live). I honestly don’t even know where to start so I’ve Googled around, asked ChatGPT, tried to find other examples but 🤷🏻‍♂️. ...
No description

Errors even tho the fetch works

I got lots of errors regarding join, fn, desc and other stuff
No description

has anybody gotten drizzle rds and postgis working?

I've tried over multiple weeks now I cannot get postgis to work on aurora v2. Anybody been able to get geography points working? It's a huge blocker for me.

hey there! is there any chance to get migrations from code instead of cli?

Hello, I'm currently using Drizzle ORM and I am wondering if there is a way to generate migrations from code instead of using the CLI. Here is a code snippet demonstrating what I'm trying to achieve: ```ts...

db.insert(Table).values() gives TypeScript error "Object literal may only specify known properties"

Before I begin, let me clarify I am suuuper new to Drizzle! Loving it so far! Not sure if I should provide repro just yet (happy to later), but I am getting an issue where my table which currently is: ```ts...

Error: Cannot read properties of undefined (reading 'findMany')

`import { auth } from "@/auth"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { SignIn } from "@/components/ui/signin"; import { SignOut } from "@/components/ui/signout";...

Turso Schema Database migration with drizzle-orm/libsql/migrator

hi all, having this issue with migrations using drizzle for turso schema databases (--type schema), is this somehow affected by turso running these migrations as transactions internally, and drizzle trying to run the migrations in transactions too, causing "the migration is already run within a transaction" error? 6 | rawCode; 7 | constructor(message, code, rawCode, cause) { 8 | if (code !== undefined) {...

rollback() not implemented for sqlite-core?

https://github.com/drizzle-team/drizzle-orm/blob/e922211fdbbd1218ac78440d8ded281a7f34b347/drizzle-orm/src/sqlite-core/session.ts#L223 If so, I would happily open a PR to provide a better error message than TransactionRollbackError [DrizzleError]: Rollback 😅...

Supabase + Drizzle + Nuxt 3 + Node - SSL 'SELF_SIGNED_CERT_IN_CHAIN' and drizzle-kit studio issues

Hi everyone 👋 I'm new to drizzle, and fairly new to supabase but have it up and running and fetching data ok. SSL issue...
No description

Noob question about DROP TABLE ordering

Hello! I'm about to drop my first table with Drizzle, and I noticed the SQL file looks like this: ```sql...

Updated Drizzle Kit and now all indexes were updated to use Btree? Why?

Today I generated a migration after updating drizzle-kit to ^0.22.1 It seems to have dropped all my previous indexes: Such as one that I created before the updated which generated: ...

alternative to supabase postgres and realtime?

Looking for an alternative to this setup, what would you recommend?

Drizzle push to turso clears data

the drizzle push looks like this, and when i do this, for some reason only the accounts table is fine while every other table gets cleared. there's nothing saying it will do this. this didn't used to happen, not sure why it's happening. ``` "drizzle-orm": "^0.30.10", "drizzle-kit": "^0.21.4",...
No description

issue with update from select

doing this: ```ts await db .update(stores)...