Drizzle Team

DT

Drizzle Team

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

Join

Drizzle in vscode Ts Server is very slow

please check the video, when i type something it took around 5-6 seconds to get the auto suggestion. i am on windows and a have attach my processor and ram configuration also. let me know if i am doing anything wrong

Running parallel queries

I thought I could be clever with something like this to speed up an endpoint with several queries: ```return await ctx.drizzle.transaction( async (tx) => { const threadId = nanoid();...

drizzle.config.ts issues with ESM

Today's release of drizzle-kit, version 0.19.1, added drizzle-kit's ESM support and resolved this GH issue: https://github.com/drizzle-team/drizzle-kit-mirror/issues/55. Now, resolving imports with a '.js' extension, such as
import { table2 } from './table2.js';
import { table2 } from './table2.js';
works, except for in the drizzle.config.ts file, where it will still throw an error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
. The only solution I could think of was updating my tsconfig.json to include drizzle.config....

Full Text Search

Is it possible to add full text indexes in Drizzle (MySQL)? If not, can we expect it to be supported in the future?

Same data is returned if I change the data without using Drizzle.

I have a telegram bot that queries SQLite database. Everything works as expected until I change data using my database UI client (DataGrip) directly. If I do this the data that the bot gets is not changed. Restarting the bot helps which makes me thinking there is some king of caching going on. Is it expected? If so, can it be disabled? Here are the versions of the ORM and the driver i'm using: ``` "drizzle-orm": "^0.25.4"...

drizzle-kit generate:pg throws ERR_INVALID_RETURN_PROPERTY_VALUE

I have my drizzle.config.ts file unchanged (besides adding driver) from before the recent update (see below), but after updating to latest I am getting an error: TypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected a url string to be returned for the "url" from the "drizzle-kit/loader.mjs 'resolve'" function but got instance of String. ```ts import { Config } from 'drizzle-kit'; ...

How to do migrations that require data changes?

Hi, how can I migrate a live database that requires to do a more complicated data shuffling, e.g. I have this schema: ```typescript const Pages = pgTable('pages', { id: uuid('id').defaultRandom().primaryKey(), title: text('title').notNull(),...

Typescript Problem, do you have an idea ?

Property 'user' does not exist on type 'DrizzleTypeError<"Seems like the schema generic is missing - did you forget to add it to your DB type?">'.ts(2339)`import * as schema from './schema'; import { drizzle } from 'drizzle-orm/...'; const db = drizzle(client, { schema }); ...

How do I use "the connection pooler"?

On the docs for Supabase, it says "Connect to your database using the Connection Pooler for serverless environments" but without elaborating. How do I do this? The postgres package does talk about it, but it doesn't seem to mention anything about how to do that vs a direct connection...

dynamic relational queries column returns

Hi I'm not entirely sure if this is the intended result when trying to make a relational query. ```ts //type is derived from a mysql table type User = {...

Error updating a record

I'm getting an error typescript: Cannot find name 'buildings'. Did you mean 'buildingId'? [2552] when trying to update an item ```ts import * as schema from "@/drizzle/schema" import { PostgresJsDatabase, drizzle } from "drizzle-orm/postgres-js"...

using postgres-js for connection

I am trying to setup drizzle with postgres-js package ( as document it be fastest). Referring to this doc: https://orm.drizzle.team/docs/installation-and-db-connection/postgresql/postgresjs How do i define schema using postgres-js ?? I tried import for table to my schema file and typescript shows error: Module '"drizzle-orm/postgres-js"' has no exported member ... ...

How to check if is not null

Hello,
await db.query.users.findFirst({where: (users, { eq }) => eq(users.name, 'test')});
await db.query.users.findFirst({where: (users, { eq }) => eq(users.name, 'test')});
i want to find all users where name is not null. How to do in this situation?...

Using PgArray

Hello, How can I use postgres arrays in drizzle? I want to have one column to be a string array. Thanks!...

Timestamp as string

so when i have a timestamp in string mode, setting new Date().toISOString() does not work - i need to drop the trailing Z from it can drizzle handle this?...

db push when adding notNull column with default() value

I've added this column to my table: fullfilled: boolean("fullfilled").default(false).notNull(), But when running drizzle-kit push:mysql I get this: ``` ...

Set unique index length

I'm using a custom blob column type in mysql and need to specify a unique index on it. Because it's a blob the index length must be set but there seems to be no way of doing this? Anyone have some idea?

Trouble getting query to work with subquery

I'm having trouble getting this query to work in drizzle, ```sql SELECT i., h1. FROM items i...

Generic update component using table schema – how to type the table argument?

SOLVED IN BOTTOM COMMENT I'm attempting a generic update checkbox component where I can pass a type of MySQL (PlanetScale) table, and an associated keyName, and use those params in the db.update() query. Can anyone guide me on how to type the table argument?...

require() of ES Module not supported

This isn't too related to drizzle-ORM, but I figured I'd ask it here: I'm trying to connect drizzle to my PlanetScale database like so: ```...