Drizzle Team

DT

Drizzle Team

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

Join

Typescript error with custom column type

The select rules throws a TS error: "Expected 0 arguments, but got 1.ts(2554)" What am I doing wrong?...

Infer TS types with `sql` operator and `db.execute`

``ts const db = drizzle(connection); export async function getTodos() { const result = await db.execute<Todo>(sqlselect * from ${todo}`); return result.rows;...

Migrations not working with Neon.Tech?

So i was trying to use drizzle for the first time. a little bit of a noob but im not sure what im doing wrong here. when i go to neon i can see the compute starting so it seems like there's a connection happening, but the actual table is not created? I tried using the neon driver first and couldn't get it working. and when i print my connectionString i see it properly using tsx to run the file Can anyone help? ...

Cannot read properties of undefined (reading 'connectionString')

In my drizzle.config.ts I have the code: ``` import type { Config } from "drizzle-kit"; import 'dotenv/config' ...

help with drizzle types not inferred well

``` async function addTopic(topic: string, content: string, parent?: string) { try { let parentId: number | null = null await db.transaction(async (tx) => {...

Invalid input for drizzle-kit pg:inspect

I'm running a command I've run a couple dozen times before, but now am getting an error saying I need a configuration file for drizzle kit. I added a basic configuration and am getting a generic error saying "invalid input." My drizzle.config.json has a basic out and schema entries, and I double checked the postgres URI is correct....

Invalid input Only "mysql2" is available options for "--driver"

I'm trying to run drizzle-kit introspect:mysql by following the docs and I have the config file: ``` import type { Config } from "drizzle-kit"; import dotenv from "dotenv";...

What is the type of transaction prop?

When creating a transaction I get this prop ```ts const transaction = client.transaction((tx) => {
})...

Unexpected type mismatch for sqlite integer boolean mode

Hi, you guys added boolean support for sqlite recently (thanks for that!!). It correctly expects 0 and 1 as the values in the db but I've noticed when using a default(0) it throws a ts error (see below). Setting it as a boolean default(false) does not. I'd expect to set a value in line with the expectation but perhaps my understanding is wrong? Is it a bug? ``` export const foo = sqliteTable("foo", {...

AWS Aurora MySql via AWS Data API

Is there a way to use drizzle with AWS Aurora MySql via the AWS DataAPI? I can see the option for PsotgreSQL in the documentation, but nothing about MySQL: https://orm.drizzle.team/docs/installation-and-db-connection...

Support for unsigned integers

Does Drizzle ORM support defining unsigned integers in the schema?

Why is insertId a string, not a number?

After inserting into a table with an auto-incrementing pk, the insertId in the returned ExecutedQuery is a string. Why isn't it a number?

Auto update for updated_at

Any thoughts on how I could implement an auto updated field triggered on updates only on Postgres? I see onUpdateNow() for MySql. Seems Postgres supports triggers for this. Can/should I use Postgres triggers via Drizzle? If not, does it make sense to send the updated_at over the wire from the client?...

Deleted migrations, still can't create new

I wanted to reset my entire database so I deleted my entire migrations folder and ran generate again. It says "no schema changes" and does not create a migration. Any way to force it?

How to fetch related table rows in many_to_many

I have three tables : products, collections and collections_products. Product can belong to many collections and collection can have many products. ```ts const result = await db.query.products.findMany({ with: {...

Is typescript slow for anyone else?

Typescript is incredibly slow for anything related to drizzle, I have an m1 macbook pro with decent memory so I don't think it's my machine, is anyone else experiencing this or is it unrelated to drizzle

TypeError when adding subquery to `drizzle.insert.values`

Hey all, I'm a bit new to drizzle so not sure if this is even possible or if I'm just doing something wrong. I'm getting type errors when using a subquery to select for companyId based on a company name: ```ts return await db.insert(widgetItem).values({ name: "New Widget",...