Help querying D1 with Drizzle
drizzle.config.ts:
```
import { defineConfig } from "drizzle-kit"
...Passing column values through custom TypeScript functions ...
Calling a stored procedure with an array parameter
CREATE FUNCTION demo( param1 uuid[], param2 uuid...
Large inserts throw `RangeError: Maximum call stack size exceeded`
RangeError: Maximum call stack size exceeded error. Note that I am using .onDuplicateKeyUpdate (i.e. they are upserts).
By breaking my inserted data into chunks of ~2k rows each, I can do inserts without this bug. This suggests to me that my application code is not at fault.
I'm using Planetscale/MySQL, but I don't think it has to do with the database connection - even using const query = db.insert(...).values(...) and then console.log(query.toSQL()), which normally works, gives the same error when there are this many rows. My guess is that the SQL builder is the culprit (maybe some O(n^2) recursion somewhere)....[AWS Data API] The result contains the unsupported data type CHAR.
Not possible to add a new column to schema with drizzle migrate push (pg)
drizzle-kit push connecting to a postgres db
It never adds the new column. However if the new column contains a foreign key constraint it will attempt to add that, but will of course fail because the column hasn't been created.
This has never worked in the few months I've been using drizzle kit, perhaps I'm missunderstanding the purpose of push? Does it not handle column level modificatons only new tables?...Support for NodeNext
"moduleResolution": "NodeNext" in my tsconfig.json. I use this because of monorepo and building packages with tsc. This module resolution requires importing ts files as .js.
The error it throws is this
Error: Cannot find module './schema.js'
...Nested Where Clause in Many-to-Many relation using Query

error: type "userrole[]" does not exist

weird error in production (TypeError: Right side of assignment cannot be destructured)

drizzle kit not migrating to turso properly
--type schema if this has any importance. but anyways. Always when I want to run the migration, I get this 500 error code:
```...Error handling
execute be used to correctly throw errors, or is it the same in this case?
```ts
const result = await context.db
.delete(user)
.where(and(eq(user.role, 'student'), eq(user.id, userId)))...The result after join (table alias)
library_level), but I expect libraryLevel, which is defined at the application level.
```ts
export const libraryLevel = sqliteTable('library_level', {
id: integer('id').notNull().primaryKey(),
name: text('name', { mode: 'text', length: 255 }).notNull().unique(),...unable to run drizzle studio

using drizzle with .env.local instead of .env
I am using Drizzle with Next.js, can I use.env.localfile instead of.envor It will throw an error.
/src/db/db.ts is only used from within the Next app, it should just be:
```ts
import { drizzle } from "drizzle-orm/neon-http";
import { neon } from "@neondatabase/serverless";
...
Best way to get all unique strings from string[] column
listings.tags which is a postgres string array. I want a query to find all unique strings that match a query. Is there a better or even more drizzle-y way to do this vs. my current code:
``ts
const tagsSubquery = db
.select({
tag: sql<string>UNNEST(${listings.tags})`.as('tag')...drizzle + turso config

not able to run drizzle-kit
$ drizzle-kit introspect
bash: drizzle-kit: command not found
$ drizzle-kit introspect
bash: drizzle-kit: command not found
drizzle-kit in my package.json...
weirdness with sql`CURRENT

returning() doesnt work with onConflictDoNothing