Relational queries (PlanetScale)

Hi, does drizzle-orm/mysql2 support relational queries?

I am currently using PlanetScale, but I haven't been able to find any information about relational queries in the following documents:

Ideally, I would like a developer-friendly response like this:

[
  id: 10,
  name: "Dan",
  posts: [
    {
      id: 1,
      content: "SQL is awesome",
      authorId: 10,
    },
    {
      id: 2,
      content: "But check relational queries",
      authorId: 10,
    }
]


...as opposed to a response like this:


[
  {
    id: 10,
    name: "Dan",
    posts: {
      id: 1,
      content: "SQL is awesome",
      authorId: 10,
    }
  },
  {
    id: 10,
    name: "Dan",
    posts: {
      id: 2,
      content: "But check relational queries",
      authorId: 10,
    }
  }
]


If there is any workaround for this situation, without having to use relational queries, I would greatly appreciate it if you could let me know.

Thank you for your time.
GitHub
TypeScript ORM that feels like writing SQL. Contribute to drizzle-team/drizzle-orm development by creating an account on GitHub.
GitHub
A Fetch API-compatible PlanetScale database driver - GitHub - planetscale/database-js: A Fetch API-compatible PlanetScale database driver
Was this page helpful?