Need help with join, ChatGPT says drizzle orm does not support it

4 Replies
nikivi
nikiviOP2y ago
nikivi
nikiviOP2y ago
i tried to port it myself at first
async function getTopicsForSidebar() {
try {
const res = await db
.select({ name: topics.name, parent: topics.parentId })
.from(topics)
.leftJoin(topics, eq(topics.id, topics.parentId))
.all()
console.log(res)
} catch (e) {
console.error(e)
}
}
async function getTopicsForSidebar() {
try {
const res = await db
.select({ name: topics.name, parent: topics.parentId })
.from(topics)
.leftJoin(topics, eq(topics.id, topics.parentId))
.all()
console.log(res)
} catch (e) {
console.error(e)
}
}
nikivi
nikiviOP2y ago
nikivi
nikiviOP2y ago
i wanted to try raw sql string but blocked on that too as .execute breaks for me and all docs examples use .execute
Want results from more Discord servers?
Add your server