adrtivv
adrtivv
DTDrizzle Team
Created by adrtivv on 11/6/2024 in #help
column is of type date but expression is of type text
So, I was trying this and it resulted in an error:
column \"date_of_birth\" is of type date but expression is of type text
column \"date_of_birth\" is of type date but expression is of type text
It happened when I tried updating multiple columns of multiple rows of a table. It doesn't happen when multiple columns of a single row are being updated. What causes this? I asked another person and they said that it's not necessarily a postgres issue and probably has somethi to do with drizzle orm.
6 replies
DTDrizzle Team
Created by adrtivv on 11/4/2024 in #help
How to resolve mutiple queries in a single request to postgres database?
I have more than one sql select statements that need to act independently and are not related to each other. Is there a clean, type-safe way to fetch results for all these select statements in one request to postgres instead of having to use Promise.all and making a seperate request for each select statement? Most probably what I'm asking for is a single select statement that contains the logic for all the three select statements below.
const usersQuery = db.select().from(users).where(eq(users.age, 24));
const accountsQuery = db.select().from(accounts).where(eq(accounts.verified, false));
const sessionsQuery = db.select().from(sessions).where(inArray(sessions.userId, userIds));
const [users, accounts, sessions] = await Promise.all([usersQuery, accountsQuery, sessionsQuery]);
const usersQuery = db.select().from(users).where(eq(users.age, 24));
const accountsQuery = db.select().from(accounts).where(eq(accounts.verified, false));
const sessionsQuery = db.select().from(sessions).where(inArray(sessions.userId, userIds));
const [users, accounts, sessions] = await Promise.all([usersQuery, accountsQuery, sessionsQuery]);
6 replies
DTDrizzle Team
Created by adrtivv on 10/12/2024 in #help
how to sort rows lexographically by the string value of the postgres enum column
I've read that postgres by default sorts rows by the integer value of enum columns and not their string value. Using drizzle orm how to sort rows of a postgres table lexographically by the string value of one of its enum columns?
1 replies
DTDrizzle Team
Created by adrtivv on 11/27/2023 in #help
drizzle studio blank screen
No description
11 replies