Drizzle Team

DT

Drizzle Team

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

Join

How to select a subset of fields from a JSONB?

I'm using Postgres and can't figure out how to select a subset of JSONB fields? Is this supported yet?

How to resolve mutiple queries in a single request to postgres database?

I have more than one sql select statements that need to act independently and are not related to each other. Is there a clean, type-safe way to fetch results for all these select statements in one request to postgres instead of having to use Promise.all and making a seperate request for each select statement? Most probably what I'm asking for is a single select statement that contains the logic for all the three select statements below. ```typescript const usersQuery = db.select().from(users).where(eq(users.age, 24)); const accountsQuery = db.select().from(accounts).where(eq(accounts.verified, false)); const sessionsQuery = db.select().from(sessions).where(inArray(sessions.userId, userIds));...

Semicolon separated emails using drizzle-zod.

I have the following Schema definition for drizzle-zod: ``` export const RegistroSchema = createSelectSchema(registro, { correo: (schema) => schema.correo.email(), retencionRenta: (schema) => schema.retencionRenta.optional(),...

Seeding remote D1 database by running `.ts` file

how to seed data by running .ts file for a remote D1 database?

Deprecated function table.d.ts(26, 8): The declaration was marked as deprecated here.

``` import { pgEnum, pgTable as table } from "drizzle-orm/pg-core"; import * as t from "drizzle-orm/pg-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; export const customers = table(...
No description

Drizzle studio not updating

Hello, have been trying to add to my schema file: ```const RoleEnum = pgEnum("roles", ["user", "admin"]); export const users = pgTable("user", {...

Drizzle Expo Sqllite

is it possible to implement backend Sync with drizzle-expo-sqllite, like recording all changes in a Queue and running sync periodically(or when App is online), Similar to WatermelonDB? I am new to Drizzle and sqllite, any pointers will be appreciated....

Insert IF NOT EXISTS

I'm attempting to insert a row to a table, but only if a row doesnt already exist which has the same value for the column "content" and if it does, return that row like this: ` const [resource] = await db .insert(resources) .values({ content: 'John Doe' })...

Depreciated table

Hi everyone, pgTable is marked here as depreciated but I can't understand why : ```ts export const clinicsSessions = pgTable( 'clinicsSessions', {...

Does eslint-plugin-drizzle work with the new eslint.config.js and eslint 9?

I could only find docs about the legacy eslint config format

Drizzle better-sqlite3 WAL mode

Hello! Sorry if this was asked before but I couldn’t find a way to do it by searching. How should you enable WAL mode with drizzle? Is it enough to put it inside a migration file, or you need to somehow execute it when you connect...

Drizzle-Zod not supported in latest version of Drizzle-ORM

I tried upgrading to drizzle orm 0.36, but I was having problems similar to this github issue. I downgraded back and everything is working fine. Has anybody been having this issue? https://github.com/drizzle-team/drizzle-orm/issues/3125...

Unique Constraint

I'm slightly confused as to why my unique constraint doesn't work as expected. I have the following schema: `export const userPermissionsTable = pgTable(...
No description

Foreign Key, is this method deprecated?

facing a lot of problems using this syntax, somebody can help me? `import { foreignKey, index,...

An example from the docs is marked as deprecated.

Hello, I'm using postgres and my pgTable calls are being shown as "deprecated", as well as the example in the docs. ```ts const table = pgTable('table', { id: integer('id'),...

Can I re-use my Prisma Migrations on Drizzle?

I'm migrating a project from Prisma to Drizzle, I already have a migrations folder with some migrations there. Can I have Drizzle port/convert those migrations to itself?

Is there a type for a Drizzle connection?

My use case is the following: I'm building a library dealing with a Neon database, but the connection shoud be created by the app using the library. So, all the functions of the lib expects as a their first parameter the actual connection to the database. How can I type this parameter so that the function accepts both a connection created with the Neon HTTP and Websockets drivers? Neon HTTP driver ```typescript...

composite primary key approach shows deprecate

Hi, if I follow this approach: https://orm.drizzle.team/docs/indexes-constraints#composite-primary-key to create a primary key. I get a depecrated notification....