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,
  },
});
Was this page helpful?