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 drop config file does not exist

I have a /foo/drizzle.config.ts file as suggested in the docs (https://orm.drizzle.team/kit-docs/conf). When I run drizzle-kit drop it fails because it can't locate the config file: ```...

Related object is not typed correctly

I have the following schema ``` export const menus = pgTable('menus', { id: uuid('id').primaryKey(), name: varchar('name', { length: 256 }).notNull(),...

Custom vector type with pgvector

I'm trying to use the pgvector extension with a custom type but am running into an issue with the migration file. My custom type looks like ```typescript export const vector = customType< { data: number[];...

Missing 'with' clause additional operators (where, limit, offset, etc)

Have been digging into the docs and the latest update. ❣️ In the docs (https://orm.drizzle.team/docs/rqb#prepared-statements) it shows a similar number of options for 'with' as it does for the base. The options beyond just columns and extras don't look like they are implemented yet.
Are the additional operators coming or is that section just meant to describe how to include different types of placeholders more generally? ...

drizzle-zod type errors with latest versions

I updated all drizzle deps to latest and having type errors when using drizzle-zod

I am confused on how the new relational queries works

In the docs I see the following ``` import { pgTable, serial, text, integer, boolean } from 'drizzle-orm/pg-core'; import { relations } from 'drizzle-orm'; ...

is not assignable to type 'DrizzleD1Database'

Hello This last release was amazing. Making joins simple was the missing piece for me. However, I'm trying to upgrade https://race-stack.pages.dev to the new API (it previously used the joins)....

Drizzle kit generate gives error after upgrade

I have updated drizzle-orm to 0.26.0 and drizzle-kit to 018.0. I have defined relations according to the docs, to use the relational queries. When I run drizzle-kit generate:sqlite, I am getting this error




...

Introspection error with pg

Hello, I am trying to introspect my already created DB but when I run the cli command I get: ```
drizzle-kit introspect:pg
drizzle-kit: v0.18.0...

How to declare PostgreSQL extensions/plugin?

Reference: https://www.prisma.io/docs/concepts/components/prisma-schema/postgresql-extensions Is there a way to declare postgresql plugin? Perhaps through the raw sql statement? Thanks in advance!...

How to consume existing supabase migration?

I have a supabase migrations and would like to reuse them as a starter for drizzle. When trying to point drizzle migration to the supabase's migration, it throws the error:
Error: Can't find meta/_journal.json file
Error: Can't find meta/_journal.json file
...

Prisma Studio style db explorer

Hey there! Anyone aware of a prisma studio style db-playground / db-admin-dashboard that works with drizzle? Would be super cool for developers and PMs alike ❤️...

Incorrect return type findFrist

Hi! I just upgraded to 26.0 and I'm refactoring queries to findFirst where needed. But the return type is not correctly inferred! The return type is just ```typescript...

Relations module - or condition

Hi there! I have a teams table, an users table, and a team_members table that connects these two. A team also has an ownerId column. Currently I have a query that fetches all the teams of an userId whether they are connected through the ownerId column or the join table....

Are foreign key polyfills for PlanetScale supported by Drizzle?

Hi Prisma supports this (although slow). See: https://www.prisma.io/docs/guides/database/planetscale#how-to-emulate-relations-in-prisma-client I want to use Planetscale but foreign key constraints are very important to me....

TS error: Argument of type PgTableWithColumns is not assignable to parameter of type AnyPgTable

Hi all, after updating to latest i'm getting this TS error. This is my db creation and schema. ``` import { User } from './schemas/user'; ...

Many-to-many relational query issues

schema, relations, statements: https://gist.github.com/kylewardnz/37104f989807e96555ea856294a2b670 1) executing the fetchArtistWithContent statement returns only the pivot table data on the members relation. This does make sense since it's actually a relation to that table, but logically I'm wanting the data from the members table. This can be done by changing the with statement to: ``` with: {...

drizzle-kit: push wants to change column type that hasn't changed

just updated my dependencies: ``` dependencies: - drizzle-orm 0.25.4 + drizzle-orm 0.26.0...

drizzle-kit doesn't seems picking up the default config TS (up:pg)

Hi I'd like to report that the latest drizzle-kit 0.18.0 doesn't seems to detect my drizzle.config.ts when running up:pg, it's kinda weird because my generate:pg execution is working.

Build queries dynamically with conditions.

How to build query on the basis of if-else conditions? I have tried doing it as below
let dbQuery = db.select().from(orders).where(and(eq(orders.organizationId, orgId), ne(orders.orderStatus , "CART"), eq(orders.id, Number(query))));
let dbQuery = db.select().from(orders).where(and(eq(orders.organizationId, orgId), ne(orders.orderStatus , "CART"), eq(orders.id, Number(query))));
```...