Need a review / suggestion please
Hello ,
i want to store the positions of items depending on the user preferences ( using a sortable list in which he can even move up or down one of the items )
i thought about this solution using transactions and some how two queries.
is there anybody free to take look please ...
Types in Next.js Client components
I've got a schema (
schema.ts) which defines my tables, a file for type declarations (types.ts) with things like export type Product = typeof products.$inferSelect;
How am I supposed to use these types in client components? Since the types.ts imports from schema.ts we're no longer in client-only land and I get errors like Cannot resolve module 'fs' and similar....Does Drizzle ORM HTTP proxy Driver work for D1 Http Rest API
Does Drizzle ORM HTTP proxy Driver work for D1 Http Rest API
Google cloud postgres
I am having trouble using
drizzle-kit: v0.23.0...
drizzle-kit to connect to my google cloud sql instance. I can connect just fine with @google-cloud/cloud-sql-connector but i'm not sure how to run drizzle-kit as the DATABASE_URL string is not enough.
```bash
npx drizzle-kit pushdrizzle-kit: v0.23.0...
Is it possible to use drizzle with d1 on http
Unfortunately, it's not possible to access cloudflare bindings in non worker envinroment. But I have some task functions that need to access the db but not from the worker.
Connecting with SSL
I'm using a db with
sslmode=require which I thought needed encryption, but doesn't actually check the certificate. I keep running into an error:
Error: self-signed certificate in certificate chain
Here's the code I use to create my connection singleton. ...
Update with array of objects
```ts
type StoreSpecialHours = {
storeID: StoreID;
day: Day;
dayOpen: DayOpen;...
Create a Lowercase constraint (or any custom constraint) in drizzle ORM schema
Emails should be case insensitive, so I achieve this by forcing lowercase. How do I do that in Drizzle?
RangeError: Maximum call stack size exceeded on update and delete for small number of rows (10s)
I have the following two calls that return the same RangeError:
```ts
await db
.update(schema.cards)...
Error handling
Hi,
Currently this how I handle the database error thrown from Drizzle,
```
try {
......
How to Reference a Column Type in Drizzle
Hi everyone! I used to work with Prisma, and now I've started learning Drizzle. I have a problem: is it possible to reference the type of a specific column in a table? If so, how?
In Prisma, I solved it like this:
import { Pet } from '@prisma/client';
selectedID: Pet['id'] | null;...
SELECT 'value'
Is there some way to model
SELECT 'value' without a table in drizzle?
Specifically I'm trying to do something like
```sql
SELECT...Can't create relation
Hi everyone !
I have 2 files here is the first :
```js
import { pgTable, text } from "drizzle-orm/pg-core";...

Drizzle Kit unable to migrate
Hello,
I have the following schema.ts file which is generating the following error:
```...
query execution stucks in mysql, when pooled connection
when server is idle for 10-15 mintues and db connection is pooled, then the first query or api request get stuck while query-execution. why is this behaviour, has anyone else experienced this?
Add where clause on 1-1 relation (Query mode)
I want to include relation 1-1 with where clause such as ‘isNull(table.deletedAt)’
Now i use alternative way define relations with one-many that allow me to add where clause on query mode.
and get data from first element of array
...
How to define a Many To One Relation
I've been reading the official Drizzle ORM Documentation but I couldn't find the proper way to define a Many To One Relation, if anybody has any idea, appreciate your contribution
slow code suggestions
hey guys, after adding drizzle to our code base, we've seen a drastic increase in code suggestion/completion times (be that vscode intellisense or vim lsp). there's seems to be a closed issue on this topic in drizzle's github repo, but it doesn't seem to be solved. our db is around 450 tables and 4k columns. I've upgraded to drizzle 0.32 and drizzle-kit 0.23, but it seems to be the same
Self referencing table query
So I have a
category table that references itself, each category can have a parent that is also a category.
All seems to be working fine, migration is being generated and works perfectly fine.
But then when I try to query the data with references it fails on sql error: ...