Drizzle Team

DT

Drizzle Team

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

Join

Geeting error while migration even though evrything is correct

Hello Drizzle team, I have been trying to migrate this schema but getting error (image). Can anyone tell me what i am doing wrong here....
No description

using array of ids as a where clause, using magic sql operator

I really need some help here: `` const query = sql SELECT ${Statistics.variantId}, ...
Solution:
so just doing WHERE x IN (${sql.raw(variantIds.join(','))}) will for now at least not make your site explode

Type error when using subquery in where

I get the type error:
Argument of type 'Aliased<string>' is not assignable to parameter of type 'Column<ColumnBaseConfig<ColumnDataType, string>, object, object>'.
Type 'Aliased<string>' is missing the following properties from type 'Column<ColumnBaseConfig<ColumnDataType, string>, object, object>': table, name, primary, notNull, and 14 more.
Argument of type 'Aliased<string>' is not assignable to parameter of type 'Column<ColumnBaseConfig<ColumnDataType, string>, object, object>'.
Type 'Aliased<string>' is missing the following properties from type 'Column<ColumnBaseConfig<ColumnDataType, string>, object, object>': table, name, primary, notNull, and 14 more.
...
No description

Integration tests in new pgSchema

I want to run my integration tests in a custom pgSchema called 'testing', but how to do this without redeclaring the same tables in my schema with a pgSchema before? Is there somethings like prisma does with the connection string 'postgres://user:password@host:port/dbname?schema=schemaname'?...

schema validation enforcement

``` const users = pgTable('users', { id: serial('id').primaryKey(), name: text('name').notNull(), email: text('email').notNull(),...

Unable to run drizzle query for supabase

I've tried npm, pnpm and bun to check if was something related to how modules are resolved. Here is my drizzle.ts: ```ts import { drizzle } from 'drizzle-orm/postgres-js' import postgres from 'postgres'...

drizzle with expo-sqlite

Hi, i am using drizzle with expo-sqlite for offline-first solutions and i want to know how to set flag or version to my schema that will be automatic reset on change the value of version ( drop / create i guess )

Drizzle SQLite not implicitly handling autoincrement primary key id

schema ``` import { sqliteTable, integer, text, real, blob } from 'drizzle-orm/sqlite-core'; import { relations, sql } from 'drizzle-orm'; ...

Migration and existing policy issues

When I run migrations, it fails to execute cause it says " applying migrations...PostgresError: policy 'foo' for table 'bar' already exists". First migration was fine, but now, every time I try to add a new migration file it fails on that. Ideas on how to go around it? I'm using postgres on supabase with RLS....

How to check migration history?

It would be useful to see which migrations have been applied and which have not

Drizzle-kit detecting random enums?

Why am I getting this interactive prompt? How can I force select the first option? I get this when I run drizzle-kit push using pg. ```...

Drizzle not migrating (SupaBase) when I run npx drizzle-kit migrate

In the terminal the execution get's stuck infinitely: ``` āžœ dgcl git:(main) āœ— npx drizzle-kit migrate drizzle-kit: v0.21.2 drizzle-orm: v0.30.10...

Drizzle-kit push remove interactivity?

In our GH Actions we're getting the following prompt: enum name created or renamed from another enum? Then we have to select a value, how can we stop this from happening as it's breaking our actions?...

drizzle-kit push fails every second time

Hello I'm having this annoying issue where I have to wipe my postgres database before doing a push. How can I resolve this? I'm attaching a log below, this is without changing anything in between:...

Permission denied during 'migrate' command under locked-down database

I am working on a database that has certain restrictions in place for who owns what. My account in particular has full permissions on public only. When trying to run drizzle-kit migrate, I get a [...] permission denied for database [...] error. Unfortunately, this is all I can provide unless there's a way to get logs that might help. I have my config defined as ``` // ......

"where" clause not found in "with" object

Hi, I'm trying to write a "where" clause inside a with object. I.e. I'm trying to filter events that are in certain dates in this query. The ide complains that "where" is not found. However documentation says it should work. Have a look here: https://orm.drizzle.team/docs/rqb#find-many Where am I going wrong?...
No description

Strange timestamp side-effect introduced to TypeORM when initialized drizzle db client

Hi all, Recently I have migrated our db migration tool to use drizzle-kit and it's amazing. However, while working on the ORM migration from TypeORM to drizzle, I discovered a very strange side-effect that TypeORM timestampz column stops transforming date string to Date object after initialized drizzle db client in the codebase. For example, in TypeORM, createdAt used to return a Date object (2024-05-01T15:00:00.000Z when doing console log), but after initialized drizzle db client, it becomes the raw string stored in the DB '2024-05-01 15:00:00+00'....

IN Statement

Hey folks, I'm trying to create a query that uses an IN statement such as: " SELECT * FROM Customers WHERE Country IN ('Germany', 'France', 'UK'); " How can I achieve this using methdos from drizzle-orm package?...

Studio infinite loading

Hello. I've got a problem with studio not loading tables - I mean loading infinitely. What might I've done wrong?
No description

DB-Caching?

I'm currently facing a problem where im fetching data but it wont update, it displays the values before I dropped and recreated the database? Is there something like caching of queries and how can I disable that?