Drizzle Team

DT

Drizzle Team

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

Join

Front to back end type inference with parameters sent via request

Hey there, I've been exploring using drizzle in a TRPC environment. This is probably a pipe dream, but ideally, our developers would be able to dynamically pass a findMany input and have the query's results inferred all the way to the front end. ```ts // Front end const { data } = trpc.tablename.get.useQuery({...

drizzle-zod: remove ID from insert schema type

It doesn't seem super clear from the docs, but is there a way to remove autoIncremented values like ids from the schema?

Does turso driver do not support sync methods?

The following was working fine with sqlite driver. `function insertHealthAssociation(xmlHealthAssociation: { id: number; // Esse ID é sempre 0 no json então vou ignorar na escrita e autoincrementar acronym: string;...

SSL/TLS error when running push:mysql with planetscale

any advice on how to solve this? - I am using wsl ubuntu btw...
No description

one to many same table diff column

```ts export const users = pgTable('users', { id: bigserial('id', { mode: 'bigint' }).primaryKey() }) ...

Querying based on record in another table

I have this schema: ```typescript export const users = pgTable("users", { id: serial("id").primaryKey(), name: text("name"),...

nested query

1 : i want just get comments not have reply how do it and i want just get comments have reply :
2 : i want just get comments with storeId example 1 (have relation one to many product to comment and product have storeId) :
schema :
export const comments = pgTable("comments", { id: serial("id").primaryKey(),...

Multi-App Single-Schema

Hi, I was playing around with drizzle for a Proof of Concept exercise where i have api and website that can both interact with postgresql trough drizzle. - There are some example for this use case?
- From a migration stand point is it possible a configuration of this type?...

Drizzle Studio updates a SqlLite text("", { mode: "json" }) column with "<value>"

After the mutation the updated value has quotes around it which makes it impossible to parse as a JSON object. Not sure if this also happens with other drivers...

Introspect Cloudflare D1

At the moment, is it possible to introspect Cloudflare D1 database to create the drizzle schema?

Select * with an alteration TO_CHAR

I could not find something similar and better ask (sorry if was previously answered) It's there a way to select all the rows and without specifying all of them and also muttating a value in a simple way? For example select('*', {...})...

ResolveMessage error when trying to run a query with drizzle postgres and bun

I have created a bun project with bun 1.0.6 and added drizzle-orm and postgres. I am trying to execute a basic query with this code: ```import { sql } from "drizzle-orm" import { drizzle } from "drizzle-orm/postgres-js" import postgres from "postgres"...

AWS Data API RDSDataClient Args in Production

Trying to wrap my head around how this should work in a lambda environment in production ``` const rdsClient = new RDSDataClient({ credentials: fromIni({ profile: process.env['PROFILE'] }),...

Generate column from another column postgresql

```sql CREATE TABLE IF NOT EXISTS "Organizations" ( "id" SERIAL, "name" VARCHAR(255), "lowercaseName" VARCHAR(255) GENERATED ALWAYS AS (LOWER("name")) STORED,...

SQLite performing a like is not working as expected ...

So I have a record in my DB where, e.g., the schema field "name" is equal to "Sirius" for one record. I then query as follows: ```ts...

Add even when object is null?

Hi guys, I have some issues with my schema: ```ts export const userItems = pgTable("userItem", { product_id: serial("product_id").notNull(),...

TS Types when using schema and "with"

So I've recently started a project and after using Prisma for an OSS i've been contributing to I decided to try out Drizzle. Overall really liking it, but I'm running into a weird thing where sometimes relationships will show up when added in with the with property, but other times they refuse to. For example, in this case there is a many to many relationship between users and households; a single user can belong to many households, and households can have many users. The DB schema is user <-> users_to_households(user.id, household.id) <-> household ```ts...
No description

Infer Types from Partial Select Prepared Statement

Hi all, I am not sure if I am inferring the types of a partial select properly, below is what I am trying to do: ``` export const deploymentListByOrg = db...
No description

TransactionRollbackError

Is anyone successfully using a drizzle transaction rollback in pg? I'm currently getting TransactionRollbackError even in non-pooled connection.

branches with neon

I was wondering if anyone is using Neon with drizzle in a production setup. I've got things setup nicely for development using a branch called "dev". What I'm wondering is what is the procedure now that I want to start getting my "main" branch ready. How do I do my migration into this branch given I have a number of migration files that have come along with my development process. I've been looking for some good documentation of going from development to production but I haven't found anything.
I am using Next 13 and deploy to vercel....