Drizzle Team

DT

Drizzle Team

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

Join

error: password authentication failed for user "postgres"

I'm trying to connect to my DB using Drizzle. I run the command: drizzle-kit push Here is the config:...

How can I properly compile the type of schema?

Hello. I'm currently using Turborepo to manage the monorepo. I want to separate the schema declaration of drizzle to internal package. But when I tries to export typeof schema/drizzle instance, it loses the information about tables. I tried using tsc, esbuild, tsup but still no luck. Is there anyone successfully compiled type of the schema?...

Help with helper utils

@Raphaël M (@rphlmr) ⚡ I wanted to use use snippets for jsonAggBuildObject but unfortunately I am getting some ts error. https://gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15?permalink_comment_id=5009839#file-clear-db-ts
No description

After commit hook for transactions

Hi, does somebody know whether drizzle has or is planning to add some sort of afterCommit functionality. I've seen some orms do it, and i think it wouldn't hurt drizzle to implement it....

Is Drizzle compatible with Expo React Native and Supabase?

got Drizzle set up, but was slapped with the error after running npx expo start ``` The package at "node_modules\postgres\cjs\src\index.js" attempted to import the Node standard library module "os". It failed because the native React runtime does not include the Node standard library.
Learn more: https://docs.expo.dev/workflow/using-libraries/#using-third-party-libraries ...

drizzle-kit pull from MariaDB using mysql2 driver

Hi Do you have any idea what caused this error when pnpm drizzle-kit pull from a MariaDB? ``` $ pnpm drizzle-kit pull No config path provided, using default 'drizzle.config.ts'...

generatedAlwaysAsIdentity() gets ignored by drizzle-kit

This drives me insane, am i just dumb and doing something wrong or is this a bug? I have the following schema: ```ts export const users = pgTable('users', { id: integer('id').primaryKey().generatedAlwaysAsIdentity(),...

Middleware Issues in Next.js Using Drizzle, Supabase, and NextAuth

Hi everyone! Is there anyone here who has successfully implemented middleware with Drizzle, Supabase, and NextAuth? I'm using Next.js. I initially encountered this error: Reading from "cloudflare:sockets" is not handled by plugins (Unhandled scheme). However, after deleting and reinstalling the Postgres package, this error has disappeared. Now, during login, I'm facing this issue:...
No description

Run Raw SQL with sql``

Hi all, is it possible to run unsafe SQL from an API. We have a use-case on some devices that we manage. const res = db.run(sql(${statement})); Thanks!...

How to declare optional one-to-one relationship

I have 2 tables that relate to each other in an inverse manner: ```ts export const users = createTable('users', { id: text('id').primaryKey(), email: text('email').notNull().unique(),...

Error while running migrations

Hi, so will I was trying to run migrations and the error below is what I am getting. Any experienced this to and was able to resolve it? ``` _ZodError: [ { "code": "invalid_union",...

Nextjs pages router: You may need an appropriate loader to handle this file type

next: 14.2.15 drizzle: 0.35.3 libsql/client: 0.14.0 To get PDF rendering working, it was suggested to me that I move a route from app router to pages router. Everything checks out on the type level, but I'm getting this error in runtime:...
Solution:
for anyone else running into this: needed to add transpilePackages: ["@repo/schema"] to my next config.

aggregation core queries in extras?

Saw this in the docs. How do I do a count() here? Does it require a separate query or can I still combine it into one request? the core queries links to https://orm.drizzle.team/docs/select Can I use this in the extras?...
No description

Is it possible to generate a default value concatenating with NEXTVAL?

For example, I want to do this
number: varchar({ length: 15 }).default(`'S' || NEXTVAL('number_sequence')`),
number: varchar({ length: 15 }).default(`'S' || NEXTVAL('number_sequence')`),
...

Change drizzle connection string at runtime

I have an existing drizzle instance that's exported from a module that many other modules import. I'd like to modify that instance at runtime to change the connection string. I thought maybe I could set the $client like so: ``` db.$client = new Pool({ connectionString: createConnectionString({...

Migration generation error

Hey everyone, I am new to drizzle and my use case is drizzle with mysql database using plain javascript. I have gone over the Drizzle documentations, as well as posts online to tailor the implementations to my use case. When I ran the drizzle-kit migrate command, I got the error
No config path provided, using default 'drizzle.config.js'
No config path provided, using default 'drizzle.config.js'
without creating the migration folder except for one time out of the many times i have ran that command. However, i deleted the migration folder that one time it worked because i thought something went wrong and wanted to retry. But now, I just keep getting this error with no other information to work with on sorting out the issue...

Error while using pulling schemas using drizzle-kit

Hey team, I have a doubt regarding the setup 🙂 - My setup is based on drizzle(postgres) + supabase + next-JS 14. ...
No description

Issue: Error during `db:push` - TypeError in Drizzle Kit with PostgreSQL

Hi everyone, I'm encountering a persistent issue when running the pnpm db:push command to push my PostgreSQL schema using drizzle-kit. The process fails with a TypeError related to replace() in drizzle-kit@0.26.2. Below are the details: #### Error Output:...
No description

Error in relational queries

```ts import { relations } from "drizzle-orm"; import { boolean, jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core"; import { generateId, generateTableName } from "../utils"; ...
No description

Where based on relationships?

I'm trying to query the database for a specific values which fit a filter based on relationships. Is this possible? ```ts const result = yield* Effect.tryPromise( () => db.query.productUniqueId.findMany(...