sidorares / sidorares/node-mysql2

Returning nested rows

Open
#709 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

Is it possible to return nested JSON values on queries. For example lets say we have two tables named category and post which are connected together using a FOREIGN KEY. we can use a JOIN in a query and have them in flat rows. but is there a solution to have like an array of posts in each category row to have the posts of that category or vice versa, like having a JSON containing posts. with a nested JSON containing category information?
Thanks in advance,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Begin by locating the query and result-handling entry points, then review how JOIN rows are returned and compare the requested category/post nesting with MySQL's JSON capabilities. Before implementation, define the supported input and output shape and the tests needed to demonstrate nested results.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, typescript
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.