Drizzle Team

DT

Drizzle Team

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

Join

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(),...

Transactions with the RDS Data API driver are not working

I've created a PR for this, see issue here: https://github.com/drizzle-team/drizzle-orm/issues/1171 As this is quite a blocker for us, is there someone who can look at this? There are also other RDS Data API things in the issue queue, like migrate not working, dates not working. We want to move away from the RDS Data API, but right now this is all we have 😦...

Maximum call stack size exceeded: orderSelectedFields

I'm migrating from Prisma, and trying to replace an aggregate query. I'm getting an error with the following query, which is—as far as I can tell—right from the documentation on aggregate queries: https://orm.drizzle.team/docs/crud#aggregations ```js await db .select({...

Bun `.get()` not working

Hi, just checking to see if there is any progress on this issue https://github.com/drizzle-team/drizzle-orm/issues/777. Maybe we also could a Discord tag for Bun?...

drizzle-zod failing

the createInsertSchema function is throwing errors when being used with @hookform/resolvers/zod, it's weird ```ts // Form component ......

Error: D1_ERROR: Error: not authorized

This works in local dev, and my other CRUD routes work without issue, however the following code throws error Error: D1_ERROR: Error: not authorized in production. Anybody have any ideas? Is something not supported in D1 like returning() or transactions or something? I'm using Miniflare in dev and it works here. ```ts...

How to updateNow for datetime?

How can I automatically update a datetime when the row is updated for mySQL?

drizzle-kit failing with Top-level await is currently not supported with the "cjs" output format

Can't seem to get drizzle-kit generate to run? PS \sst\packages\core> node --version v18.17.1 ...

postgres push issue

have a table like this ``` export const orgUserInfo = pgTable( "org_user_info", {...

Drizzle cannot run directly in loader/action

So I have been in the process of switching over from prisma to drizzle and I have hit a huge roadblock. Right now the only way that I can run queries is in server files. Every-time I try to run drizzle queries directly in loaders or actions it prevents the page from loading. The only way I can get it to work is to move the queries into server files and then import it into the route that I am using it in. Following the chain of issues down the call stack I end up in an aws-sdk file with the error code "No Providers in Chain"...