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/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. ```...

Question about Live Queries and when they update

From my testing, it appears that Live Queries only actually update if the main table being queried from are updated. Is this correct? So if I useLiveQuery with a large relational query that loads a bunch of nested stuff, if any of that nested stuff is updated, I won't get notified. Only if the top level table changes. I'd love to know a little bit more detail about how this all works so that I can better understand in what situations the change listener fires. Is this documented anywhere?...

[Solved] Aliasing a column

Is there any way to alias a column on a select? I mean an actual alias on the final query.. In starting to test out the new views support (amazing btw), I noticed a "problem".....

[solved] SQLite in expo with useMigrations is failing without any error (just rollback)

I just tried to add a bunch of indexes to my SQLite DB, and the migration consistently fails to apply and I'm not getting any useful error message. Anyone have any ideas or how to better debug this? `` LOG Query: CREATE INDEX person_index ON authors (url,person_id`); LOG Query:...

Error while pushing/pulling from pg DB (supabase)

``` if (column7.column_default.endsWith("[]")) { ^ TypeError: Cannot read properties of undefined (reading 'endsWith')...

[solved] useLiveQuery seems to always run the query twice

I'm using drizzle-orm in an expo app and it seems to me (with logging turned on) every instance of useLiveQuery causes the query to happen twice in quick succession. Why is this?

NULLS LAST in orderBy

I am trying to create a query and the only way i have been able to order by with nulls last is this: ```TS const rows = await db...

[SOLVED] invalid reference to FROM-clause entry for table

Hi all, I'm trying to fetch data with some joins from a postgres db. My query looks like this:...

Manual Migrations

Guys quick question, I've migrated some of the migrations manually by running the SQL queries, how do I update the __drizzle_migrations table to match the current state? so that I can use npx drizzle-kit migrate...

Help with 'in' queries

Hi - sorry if this has been asked, but it's kind of hard to search for! If it helps, I'm using cloudflare's D1 database (sqlite). What I'd like to do is the following query:...

Can't create relation between two tables

I'm trying to create a relation between a clients table and a sheets tables where a client can have multiple sheets linked to their ID, but I keep getting complaints about incompatible foreign keys due to my bad schema Fixed; for anyone wondering, instead of using references(() => clients.id) very shallowly you have to create proper relations like such: ```ts...

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './connect' is not defined by "exports"

Hi, i have a strange error. I installed sqlite and drizzle, but cannot make drizzle work. I have this strange error....