Drizzle Team

DT

Drizzle Team

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

Join

There's no drizzle-orm/connect anymore?

I'm on the latest vestion and I'm seeing this. I thought it was release on 0.34?
No description

Greater than comparisons with timestamp mode string

I'm getting type errors with the gte comparison operator on a timestamp column that has a mode of string. The mode should only affect the output data type of queries, not the type in the DB right?

Custom migration

I have a user table where the userId (FK) is a serial and I want to convert it to uuid. There is already data in that table. How can i do this custom migration? Do I need to create a custom migration file and write the DML?

drizzle-kit introspect schemaFilters parameter ignored

When I try to execute the following on the command line, always the "public" schema is used and not the "pgmq" schema. It's as though --schemaFilters is being ignored. Am I doing something wrong? ``` npx drizzle-kit introspect --url="postgresql://postgres:postgres@127.0.0.1:54322/postgres" --dialect=postgresql --schemaFilters pgmq --out test Pulling from ['public'] list of schemas...

Unable to sort relational query

The docs says this should work: ``` await db.query.posts.findMany({ orderBy: (posts, { asc }) => [asc(posts.id)],...

The tablesFilter option doesn't work

No matter what I try I cannot get the tablesFilter option to work. It always migrates all tables regardless of if I am using push or generate package.json `{...

Why does drizzle want to request the same column twice from db?

So basically this is my function: ``` async getUserByToken({ token }: { token: string }) { const sq = this.db .select()...

Error with tipe in InferInsertModel

Hello! I have a table visit with an optional field comment (it is not marked as notNull). However, when I use InferInsertModel to type the data for insertion, the comment field is not included.
No description

Has anyone gotten Tauri v2.0 sqlx to work with drizzle?

Hi, I'm wondering if there is a way to make drizzle work with Tauri's SQLite driver? It would be nice to have simple type safety when working with the SQLite DB in the Tauri frontend. Does anyone know if it's possible to make this work? https://tauri.app/plugin/sql/...

0.36.0 - The third parameter in Drizzle ORM becomes an array

Hello guys, I'm trying to setup Auth.js with Neon Postgres + Drizzle Adapter. The example given at think link: https://github.com/drizzle-team/drizzle-orm/releases/tag/0.36.0 for third param becomes an array is too basic for me to understand how do I change Auth.js schemas for accounts and sessions table to work with new version of Drizzle. I'd very much appreciate if someone can change the following schema from object to array for third param i.e. setting up a compound primary key. Thank you. export const accounts = pgTable(...

Read Replica Health Check

Is there a way to health check read replica or not needed because it switches to primary? also is there a better way to check if connection is working properly? at the moment I query a table. ```ts...

Hi, can I ask if anyone got CORS issue when running drizzle studio on windows with seveltkit?

Hi, can I ask if anyone got CORS issue when running drizzle studio on windows with seveltkit?

Read Replica Type Annotation

How do I properly type the read replica global variable.
No description

Enum Type Creation

Having a small issue where when I run generate, my enum type is not being created, giving, an error when migrating: This is at the top of the schema. ```ts...

TS2353: Object literal may only specify known properties, and where does not exist in type

Hello everyone! I have an error when trying to create a nested filter. ``` export const user = pgTable('users', { id: uuid('id')...
No description

Double nested return giving type error but works in run time

```ts const result = await db.select({ nesting_one_level: { nesting_two_level: { ...getTableColumns(MyTable)...

drizzle seed with postgress this error: Cannot find package '@electric-sql/pglite'

``` import { drizzle } from 'drizzle-orm/node-postgres' import { reset, seed } from 'drizzle-seed' import { user } from '../schema'...

indexes with pgTable deprecated

Using drizzle-orm: 0.36.0 I followed the docs creating indexes: https://orm.drizzle.team/docs/indexes-constraints#indexes--constraints However i'm getting a warning concerning a deprecated use of pgTable. Here's my code:...

How to query join table with db.query syntax?

Here is my schema for User, Library and LibraryUser tables.. ```typescript import { relations } from "drizzle-orm"; import { uniqueIndex, uuid, varchar } from "drizzle-orm/pg-core";...

Local Testing for D1?

before, to test locally with drizzle and d1: ```json "gen-local-db": "npx drizzle-kit generate:sqlite", "init-local-db": "npx wrangler d1 execute clients --local --file=$(ls ./drizzle/*.sql| head -1)"...