© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
8 replies
Hayato

Relational queries (PlanetScale)

Hi, does
drizzle-orm/mysql2
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:

- https://orm.drizzle.team/docs/rqb
- https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/mysql-core/README.md
- https://github.com/planetscale/database-js

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,
    }
]
[
  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,
    }
  }
]
[
  {
    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.
Relational queries – DrizzleORM
Drizzle ORM | %s
GitHub
drizzle-orm/README.md at main · drizzle-team/drizzle-orm
TypeScript ORM that feels like writing SQL. Contribute to drizzle-team/drizzle-orm development by creating an account on GitHub.
drizzle-orm/README.md at main · drizzle-team/drizzle-orm
GitHub
GitHub - planetscale/database-js: A Fetch API-compatible PlanetScal...
A Fetch API-compatible PlanetScale database driver - GitHub - planetscale/database-js: A Fetch API-compatible PlanetScale database driver
GitHub - planetscale/database-js: A Fetch API-compatible PlanetScal...
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Planetscale Serverless for Relational queries
Drizzle TeamDTDrizzle Team / help
3y ago
Relational queries with planetscale - findMany etc undefined
Drizzle TeamDTDrizzle Team / help
3y ago
Conditional Relational Queries
Drizzle TeamDTDrizzle Team / help
3y ago
Help with relational queries
Drizzle TeamDTDrizzle Team / help
9mo ago