DT
Drizzle Teamhunt
Help building queries based on multiple conditions from an array of objects
Hello, I'm having trouble formulating a query that will match rows to multiple conditions at the same time.
Suppose I have an array of objects like :
and a Table1 with :
where param1 should match up with col1, and param2 should match with col2.
In this example, how can I query Table1 so that I only retrieve rows where (col1 == "val1" && col2 == "val2") or (col1 == "val3" && col2 == "val4") ?
If I extract all the values of param1 and param2, and use them each in an inArray, like :
I run the risk of also returning values such as
col1 == "val1"
col2 == "val4"
and
col1 == "val3"
col2 == "val2"
which were not in the original array.
Is there a way to do this?
Thank you
Sillvva•17d ago
Something like this:
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
7.4KMembers
View on DiscordWant results from more Discord servers?
More PostsPostgres.js type error string/dateI'm running the following where clause in a select query:
```
.where(
and(
gt(
sql`${e.add a prefix to UUID?I am wondering if there is a functionality where I can add a custom prefix the uuid's. These uuids w[BUG?] Handling Postgresql schemas when using enums"drizzle-orm": "^0.30.10"
Hello. I have a simple table with a status column
```ts
export const BaseSHelp needed for Nested QueryFor this example, I have 4 tables - `user`, `podcast`, `episodes`, and `bookmarks`.
- bookmarks tabl