Drizzle Team

DT

Drizzle Team

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

Join

When using Deno, is it still needed to install the dotenv and tsx packages?

Deno already comes with first-class support for TypeScript and built-in support for environment variables.

drizzle-kit for production

I want to setup drizzle-kit for production but i cannot put db credentials for the prod db in the config file since it'll be commited to a source repository. How will I do migrations in production?

SyntaxError: Expected ',' or '}' after property value in JSON at position 54561

``` No config path provided, using default 'drizzle.config.ts' Reading config file '/Users/farhan/dev/omni-fe-v2/drizzle.config.ts' SyntaxError: Expected ',' or '}' after property value in JSON at position 54561 at JSON.parse (<anonymous>)...

TypeError: Cannot read properties of undefined (reading 'replace')

I'm switching from Option 3 to Option 2 from this document https://orm.drizzle.team/docs/migrations I used drizzle-kit push to push my new schema changes to Supabase database but got this error ``` .../node_modules/drizzle-kit/bin.cjs:20104...

New version Not use IF NOT EXIST'S anymore

At the latest version of drizzle-kit with Postgresql, when generating a new table, they do not come anymore with CREATE TABLE IF NOT EXISTS I don't know if is the expected behavior, but I didn't like! 0.30.0 vs 0.28.1...
No description

Please provide required params for AWS Data API driver:

This seems to have been asked a few times, but I could not get it to work. I was facing an issue where my PgViews were not getting generated, so after not finding anything, I decided to upgrade my drizzle-orm and drizzle-kit versions. Now, running pnpm drizzle-kit up results in...

Problem with ENUMs PostgreSQL

Hey all! I've been having issues with Drizzle migrate and would like some support in regards of how to fix the issue, regardless of what I do I keep getting the following: [⣻] applying migrations...error: type "activity_log_activity_enum" already exists...

I messed up my supabase and drizzle setup

To start off, databases and ORMs I am not super familiar with and didn't realize I was just directly running migrations against the production db 🙃 so after chatting with some folks I decided to install docker and run pnpm supabase start locally and that ended up failing due to ``` ERROR: column "class_year" cannot be cast automatically to type integer (SQLSTATE 42804) At statement 1: --> statement-breakpoint ...

drizzle-postgresql migratin error using nestjs framework

hello guys can you help me with this when ever i try to migrate i get like this error but drizzle-kit generation work why is this migration is not working ?
No description

im getting problems with drizzle schemas

Hi everyone, I'm having a problem with the schemas, they all work except for transportistShema. If I add this one, I get the error TypeError: Cannot read properties of undefined (reading 'Symbol(drizzle:Schema)') ```js...
No description

Defining nested types with Drizzle Zod

What would be the correct way to create nested types with drizzle-zod here? I have an acccount table like this: ```ts...

Drizzle Kit Generate renames columns incorrectly

I am running a drizzle-kit generate. It appears to think I added/renamed a column on all of my tables that does not exist. Any help on how or why this is happening would be appreciated!
No description

drizzle-typebox infers integer() as TString

I've tried it on Github Codespaces and my machine, both times the types are inferred wrong. Is anyone else dealing with this? Here's the code: ```ts import * as t from '@sinclair/typebox'; ...
No description

Too many nested objs on many-to-many relations

I get an object like ```js [ { "id": "43119ea8-a293-4c89-aaba-4d699f89e34f",...

Can't seem to $count in multi relation query

I trying to get the count of "clicks" from a table 2 relations deep. Querying for posts by a creators id, getting each posts link for a given guild id, and counting a clicks table tracking clicks for a given link. I can't for the life of me find a nice way to do this in drizzle any assistance would be helpful! ...

Timestamp IS NULL on where condition returns "status": "success"

Hello, I cannot understand the result is altered when I put a condition on the timestamp....
No description

How to set opclass for index with custom sql column

we do have following definitions, after we used drizzle-kit pull
uniqueIndex("sap_id_upper_trim_idx").using("btree", sql`upper(TRIM(BOTH FROM sap_id))`),
uniqueIndex("sap_id_upper_trim_idx").using("btree", sql`upper(TRIM(BOTH FROM sap_id))`),
...

Column of relation already exists

I have a couple of tables ```tsx export const schoolReferences = pgTable( 'school_references',...