netwrx
netwrx
Explore posts from servers
DTDrizzle Team
Created by netwrx on 4/18/2024 in #help
is it possible to do conditional relational queries?
bump :/
4 replies
DTDrizzle Team
Created by netwrx on 4/18/2024 in #help
is it possible to do conditional relational queries?
if i do something like this
const post = await db.query.posts_table.findFirst({
where: eq(posts_table.id, post_id),
with: {
author: {
where: eq(users_table.public, true),
columns: {
username: true,
display_name: true,
public: true,
},
},
},
});
const post = await db.query.posts_table.findFirst({
where: eq(posts_table.id, post_id),
with: {
author: {
where: eq(users_table.public, true),
columns: {
username: true,
display_name: true,
public: true,
},
},
},
});
it works. but im getting typescript errors. is this a bug with drizzle?
4 replies
DTDrizzle Team
Created by Jitendra on 4/15/2024 in #help
where clause when using 'with' in relational mode
i believe i have a similar issue https://discord.com/channels/1043890932593987624/1230519866113654785 do you think you could share some insight 😓
19 replies