one to many query

In Drizzle you can make a one to many query like this:
const result = await db.query.users.findMany({
    with: {
        posts: true            
    },
});

with that query I get the user and its posts

there are some questions that I have

  1. Can I use pure SQL in that query that uses the ORM-like syntax?
  2. how can I write a query with the SQL-like syntax that allows me to select for each table separate fields
Was this page helpful?