How do relational queries work under the hood?

Just trying to further my understanding of how drizzle works - how would the following relational query be written using the sql-like drizzle syntax?
const post = await db.query.posts.findFirst({
with: {
comments: true,
},
});
const post = await db.query.posts.findFirst({
with: {
comments: true,
},
});
2 Replies
Angelelz
Angelelz2y ago
You can pass {logger: true} to the drizzle object when instantiating That will log the query to the console for inspection
zendev
zendevOP2y ago
Cool thanks

Did you find this page helpful?