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: Cannot find module "@libsql/linux-x64-musl" from "~/todion/node_modules/libsql/index.js"

error: Cannot find module "@libsql/linux-x64-musl" from "~/todion/node_modules/libsql/index.js"
No description

Updating with a subquery

Can I do this in Drizzle without the raw SQL? ``js db.execute(sql UPDATE feeds AS f...

MySQL Blob

is there support for mysql blob type?

Prepared Statement - Neon Syntax Error

Hi there, I am trying to use a prepared statement to run a query but am getting a syntax error. below you can see the .toSql() logged, as well as the error. ```...

many to many relation problems

I'm using planetscale and can't seem to figure out what is wrong with this relation. There's no autocompletion for with when using the RQB and trying to access the table manually throws an referenced table error ```ts // schema export const organizations = mysqlTable("organizations", {...

Getting typescript errors with latest version

I am currently getting this error when i upgraded to the latest version. The schema was auto generated by drizzle....
No description

Select data from related table as well

I have 2 tables: ```javascript export const foos = pgTable( "foos", {...

Subqueries with INSERT - errors

I'm trying to create an insert that uses a subquery ```ts const sq = db.select({id: orgs.id}).from(orgs).where(eq(orgs.publicId, input.orgPublicId)).as('sq'); const insertOrgResponse = await db.insert(orgInvitations).values({ orgId: sq.id,...

Postgres read slaves?

Is there a way to connect the orm to use a read slave for selects and master for writes?

Migrate using Neon and Sveltekit

this is my code ```ts import { pool } from '$lib/server/db'; import { drizzle } from 'drizzle-orm/neon-serverless'; import { migrate } from 'drizzle-orm/neon-serverless/migrator';...

Cannot find driver! mysql2 or pg.

I'm trying to run drizzle-kit studio can get this error: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'mysql2' imported from C:\Users\rober\code\projects\drizsup\node_modules\drizzle-orm\mysql2\index.mjs Here is my drizzle.config.ts: ...

Relationships: Self one-one & one-many

I have a table called convoMessages Trying to add a self relation of one to one But also a self relation of one to many Drizzle Studio is throwing an error of ...
No description

No transactions support in neon-http driver even though neon provides a transaction function

https://neon.tech/docs/serverless/serverless-driver#when-to-use-the-neon-function-vs-pool-or-client I tried to execute a db operation such as below. I am getting throw new Error('No transactions support in neon-http driver'); I'm not sure if the kind of code below is an "interactive" or "non-interactive" transaction, but wondering if maybe I am missing something. Does drizzle support the neon(...) transaction() function?...

push:mysql dropping unique index

i think drizzle generates the following when it needs to drop a unique index
ALTER TABLE `stage` DROP CONSTRAINT `name`;
ALTER TABLE `stage` DROP CONSTRAINT `name`;
...

any way to push to a sqlite database using javascript? without using the command

I am making an app with electron and wants to save some data in a sqlite database using drizzle orm but i want the sqlite database file to be automatically created with the schema the first time the app launches

Transactions for DB reset in testing

Hi, has anyone leveraged DB transactions as a wrapper around all DB calls within a test so that it can be rolled back at the end of a test process (We're currently purging all tables directly, but that seems inefficient really).

pgEnum in multiple tables

How should I use the same enum in multiple tables? For example I have this enum in: ``` const ROLES = ['owner', 'admin', 'editor', 'viewer'] as const const roleEnum = pgEnum('role', ROLES)...

Connection SSL/TLS

I'm trying to introspect my database from planetscale but when I run the command I get an error of: Ignoring invalid configuration option passed to Connection: ssl{'rejectUnauthorized':true}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection C:\Users\rober\code\projects\drizsup\node_modules\drizzle-kit\index.cjs:35618 ...

Timestamp from Postgres returns date object despite schema using string mode?

Hello team, I'm confused if this is a bug because I haven't seen any other threads about it. When I define my timestamp columns like this: ```TypeScript effectiveDate: timestamp("effective_date", { withTimezone: true, mode: 'string' }).notNull(),...