Drizzle Team

DT

Drizzle Team

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

Join

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 [email protected]. 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(...

I am getting an error when I defined the db

I have downloaded the necessary package using the bun but still it's throwing an error.
No description

Pgschema

Hi all, can anyone guide me on the correct syntax for querying from a table with a table schema? Everything in public works fine with like db.query.publictable.findmany but as soon as I have a table with a custom db schema like myschema.table and Iโ€™ve added it to db I canโ€™t query with db.query.myschema.table.findmany

Custom column type

is this posible?
const intZeroNotNull = integer().default(0).notNull()
const intZeroNotNull = integer().default(0).notNull()
and how i should make it work, because this doesn't...

I deleted table generate went well but on migration it makes error that table doesnt exist

I deleted one table called stripe_keys i made drizzle-kit-generate went well not errors but after migrating i get error that table does not exist what should I do?

bug when using push for sqlite indrizzle kit on latest

TypeError: This statement does not return data. Use run() instead ``` npx drizzle-kit push No config path provided, using default 'drizzle.config.ts'...

DrizzleZod - Can't use "createSelectSchema"

Hi! I have an issue with drizzle-orm & drizzle-zod from the beginning of my turborepo project. Packages: ``` ...
No description

Marking a Query relation as `required`?

I currently have a query like: ``` const friendTransactions = await db.query.transactions.findMany({ with: { splits: {...

Type Error when inserting into table

I'm getting as error when trying to insert into a table using: ``` await db.insert(users).values({ id: userId,...

Using the drizzle-graphql with custom defined types.

I'm trying to use drizzle-graphql but, it's breaking with this error:
Error: Drizzle-GraphQL Error: Type custom is not implemented!
Error: Drizzle-GraphQL Error: Type custom is not implemented!
I have a couple of custom column types like timerange but, it seems like it's breaking the library....

Struggling to build common pattern with queries -- fetching with count + offset/limit pagination

Hi team! Love what you all are doing with Drizzle. I have an extremely common pattern that I use in my application which is using Drizzle queries to create paginated results like so: ```ts export const getFullSlots = async (options: GetFullSlotsOptions) => {...