Drizzle Team

DT

Drizzle Team

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

Join

How to apply "where OR condition" and "lt or gt condition" on timestamp fields

Hello, i woud like to apply 2 conditions: - OR condition - if basketItem invoicedOn is newer than basketItem InvoicedOn with 1 hour added to it...
No description

SQLITE deprecation warning

Anyone knows why am I getting this warning ? "drizzle-orm": "^0.38.0" "drizzle-kit": "^0.30.0",...
No description

pgEnums error in studio drizzle runner

Anyone have any ideas why my enums are like this in studio? It technically sends and works just fine just gives an error about the enum value being wrong. Only in studio not orm
No description

Drizzle ORM issues

Running into weird issue with ORM where Query: select "id", "name", "email", "emailVerified", "image", "password", "role", "isNewUser", "invalidlogin_attempts", "lockedAt", "isTwoFactorEnabled", "created_at", "updated_at" from "dds_users" "users" where "users"."email" = $1 limit $2 -- params: ["xxx@gmail.com", 1] ⨯ TypeError: value.toISOString is not a function at PgTimestamp.mapToDriverValue (C:\MyFiles\Saas\next-progress-saas.next\server\chunks\ssr\5f296_drizzle-orm_pg-core_f7448a..js:1958:22)...

Primary key is not applied

Drizzle doesn't generate a primary key statement in the migration. Here is the schema: ``` export const usersTable = pgTable( "users", {...

Challenges with Drizzle Kit Workflow Using a Single Database for Development and Production

I'm currently employing a single database for both development and production environments, as my project hasn't gone live yet. My workflow is as follows: 1. Develop locally, modifying the schema and executing drizzle-kit push to apply changes directly. 2. Once satisfied with the database structure, run drizzle-kit generate to create migration files. 3. On the remote environment, execute drizzle-kit migrate to apply pending migrations....

How to run drizzle studio in a docker container?

Hi,is there any way to run drizzle studio in an container or change the url from https://local.drizzle.studio?port=3333&host=localhost to something like localhost:3333?

D1 Remote in localhost?

Has anyone figured out how to connect to the production d1 DB in localhost? in wrangler is enough to add --remote

Drizzle GraphQL bug with SQLite JSON (Turso)

Hey, just found that it doesn't "decode/extract" the JSON when we have text({ mode: 'json' }).$type<{ [key: 0x${string}]: number }>().default({}) I'm using GraphQL Yoga to check the seeded data, and it shows that column as plain string, not extracted json. Probably bug in your graphql resolvers. Or this is intentional? I don't see why would it tho....
No description

onedollarstats not showing any stats (olshansky.info)

I added support for onedollarstats in the hugo theme I use [1]. I confirmed that the deployment has the script (see screenshot). I waited a week (just in case aggregation took time) and it's still showing 0 stats....
No description

Urgent help with drizzle-kit commands

Hello Devs! I have a project using pnpm. I have added drizzle-orm v^0.37.0 as dep and drizzle-kit v^0.29.1 as devDep. and a drizzle.config.ts at the root folder but when I run pnpm drizzle-kit generate or other commands like push or migrate, it exits with code 1 with message: "This version of drizzle-kit requires newer version of drizzle-orm Please update drizzle-orm package to the latest version 👍". I don't understand what seems to be the issue here yet both drizzle packages are latest versions....

How to use subqueries with query

```js const jobsDb = await db.query.jobs_table.findMany({ where: notExists( db .select()...
No description

Why does drizzle.config.ts have trouble recongizing my db url by not individual credentials?

When I use the url property to connect to my instance, I get an error saying it can't authorize the db user, but when I use the individual parameters such as, host, post, user, pass etc... it works. It's as if it's not reading the enviorment variable correct. Does anyone else have epxerience with the same issue and have found a solution to just using the url parameter?...

Unable to resolve "drizzle-seed"

```ts import { drizzle } from "drizzle-orm/expo-sqlite"; import { openDatabaseSync } from "expo-sqlite"; import { exercise_label, exercises, labels, sets } from "@/db/schema"; import { reset, seed } from "drizzle-seed";...

How to make a nullable field from table schema be notNull using drizzle-zod?

In this case, I want to make the last_name a required field in the updateProfileSchema. ```ts export const profile = mysqlTable("profile", { first_name: varchar("first_name").notNull(),...

How to add comment on postgres table columns (and other one-time operations like add trigger)

I want to add comment on columns of my postgres table (COMMENT ON COLUMN). There is no native function in drizzle. I can see suggestions like ``` export default {...

No schema changes, nothing to migrate 😴

I'm trying to run a very basic setup and drizzle-kit doesn't pick up on the schema. I've been... fighting this for a bit. Basically out of ideas. ```TS // ./db/schema.ts import { integer, sqliteTable } from "drizzle-orm/sqlite-core";...

To make it so that the insert query is executed when “db.insert(table).values(rows)” was called

As shown below, I want to insert a large number of records into the table in several parts, but when “db.insert(table).values(rows)” is executed, the insert query is not issued, and the query is issued after the entire loop is completed. ```typescript import * as relations from "~/infrastructure/drizzle/relations"; import * as schema from "~/infrastructure/drizzle/schema";...

New error just started appearing in Drizzle Studio...

ERROR: bind message supplies 0 parameters, but prepared statement "sqlx_s_53" requires 1; SQLState: 08P01 unclear why this is occurring and how to fix it....