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 Studio fails to run due to TypeError

pnpm drizzle-kit studio, won't launch Studio. It was working fine, but I added a few new tables and relations to my schema and it won't launch. The strangest part is generate and migrate run without errors. Here is the error output: ```...

Querying groups where a given user id is a member

The ideal SQL I'm trying to replicate is the following: ```sql SELECT groups.id, groups.type,...

Module "drizzle-orm/node-postgres" has no exported member 'migrate'

Hi, I'm trying to setup basic app with drizzle for the first time and im following option 4 instructions (generating sql migrations and applying at runtime) link: https://orm.drizzle.team/docs/migrations and I'm unable to import the migrate function. Any clues? Versions: ```json {...

SQL_NO_STATEMENT

cant make my migration migrate to turso, brings up this error: ResponseError: SQL string does not contain any statement...

could not determine data type of parameter $2

export function duration(duration: string) {
return sql`now() + interval '${duration}'`;
}
export function duration(duration: string) {
return sql`now() + interval '${duration}'`;
}
...

sql operator automatically inserts wrong json quotes around expression

const sqlString = sql`select * from ${workflows} w where JSON_CONTAINS(w.definition, '{ "data": { "formId": "${formId}", "type": "form_submission" }}', '$.nodes')`;
const sqlString = sql`select * from ${workflows} w where JSON_CONTAINS(w.definition, '{ "data": { "formId": "${formId}", "type": "form_submission" }}', '$.nodes')`;
With this I get the following error ```bash...

`pageId` does not exist when inserting, even though it's in the schema

I have the following schema: ``` export const scrapeStatusEnum = pgEnum("scrape_status", [ "error", "not-enough-information",...

Is there a way to create this query in drizzle?

Hi, I have this query for my mobile app with expo and react native. I need to have a recursive query, but cant seem to find how to create one in drizzle. ```sql WITH RECURSIVE LabelHierarchy AS ( SELECT id, name, parent_id FROM labels...

Error while providing Schema to drizzle client.

Getting error while providing schema to drizzle client. Here are my files, do let me know what am I doing wrong. ``` Type 'typeof import("d:/workspace/template/src/database/schema/index")' is not assignable to type 'Record<string, never>'. Property 'users' is incompatible with index signature....
No description

“If does not exist” for migration schemes and add a column to an existing table

Hello, I'm new to Drizzle, and for a project with postgres and NextJS, I'd like, during a migration, to specify that schemas must not be recreated. db/schemas.ts: ...

Drizzle/better-auth + Local PSQL

I have the biggest issue trying to setup drizzle with my project and I don't believe it should be this complicated as I am facing currently. Someone with more experience please help me out and explain to me what I am doing wrong. So I am trying to setup better-auth with Drizzle + my local PostgreSQL and I am using the latest version of Next js for my project. I basically start of my initialising my next js project by running the regular command npx create-next-app@latest (app router no src-folder) and go then install drizzle following the docs and run the commands that are shown in the docs/guide. I create my .env file and setup my DATABASE_URL="postgres://postgres:mypassword@localhost:5432/postgres" and move on to creating my db directory and place the index.ts file inside of it which holds this code. ...

turso

I have previously deployed without any problems in turn and now I can't, did they change something?
No description

is there equivalent to drizzle-graphql for rest api?

I need to send queries from angular, so I need the filter types for each table in client side graphql can do that exporting the filter type to client like https://github.com/drizzle-team/drizzle-graphql/blob/main/src/util/builders/common.ts can we export the filter types to use it in angular or any client framework?...

Trying to pass transactions or db

Hi there drizzle community, could someone help me with this issue? https://github.com/drizzle-team/drizzle-orm/issues/3140

Prisma to DrizzleORM Issue

Hi, I just switched to DrizzleORM in my hobby project which is a Remix App hosted at Vercel using Turso. Locally everything works fine, but when I deploy it to Vercel, I get the following error on login page....

inArray not working as expected

This works but looks like a (sql injection) const tagsArray = selectedTags.map((tag) => '${tag}').join(', '); where.push(sql${tagData.tags} @> ARRAY[${sql.raw(tagsArray)}]::text[]); ...

applying migrations... PostgresError: column "x" cannot be cast automatically to type x

when I modify a column from type text to enum ``` export const channelSubscriptionsTable = pgTable("channel_subscriptions", { ... subscription_type: text("subscription_type"),...

type definition for tables in customer function

I am Making helper function which need two args like ```tsx function helper(db , tables){...

New critical Build error drizzle 0.35.0 with Cloudflare

EDIT: FIXED WITH VERSION 0.35.2 Since updating from 0.34.1 to 0.35.0 i encounter this error when i try to build the project localy or on Cloudflare itself, on version 0.34.1 the issue does not exist. ```...