Skip to content

Commit

Permalink
collapsible
Browse files Browse the repository at this point in the history
  • Loading branch information
kostasb authored Nov 29, 2023
1 parent fcdf6e8 commit 7071e9a
Showing 1 changed file with 50 additions and 47 deletions.
97 changes: 50 additions & 47 deletions 040-SDK/101-get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -446,56 +446,59 @@ INNER JOIN "authors" ON "posts".author = "authors".id

</TabbedCode>

Example output:

<TabbedCode tabs={['Kysely','TypeScript','SQL']}>

```jsonc
[
{ "name": "Alexis", "title": "Scientific article" },
{ "name": "Joan", "title": "Scientific article" },
{ "name": "Joan", "title": "Sports article" }
]
```

```jsonc
[
{
"author": {
"id": "rec_clfpff3ivf68v40hnqag",
"name": "Alexis"
},
"id": "rec_clfpfl0k22og0hc0bpt0",
"title": "Scientific article"
},
{
"author": {
"id": "rec_clfpfg8k22og0hc0bpsg",
"name": "Joan"
<details>
<summary>Example output:</summary>

<TabbedCode tabs={['Kysely','TypeScript','SQL']}>

```jsonc
[
{ "name": "Alexis", "title": "Scientific article" },
{ "name": "Joan", "title": "Scientific article" },
{ "name": "Joan", "title": "Sports article" }
]
```

```jsonc
[
{
"author": {
"id": "rec_clfpff3ivf68v40hnqag",
"name": "Alexis"
},
"id": "rec_clfpfl0k22og0hc0bpt0",
"title": "Scientific article"
},
"id": "rec_clfpfmok22og0hc0bptg",
"title": "Sports article"
},
{
"author": {
"id": "rec_clfpfg8k22og0hc0bpsg",
"name": "Joan"
{
"author": {
"id": "rec_clfpfg8k22og0hc0bpsg",
"name": "Joan"
},
"id": "rec_clfpfmok22og0hc0bptg",
"title": "Sports article"
},
"id": "rec_clg721kcdi29f8llc22g",
"title": "Scientific article"
}
]
```

```jsonc
[
{ "name": "Alexis", "title": "Scientific article" },
{ "name": "Joan", "title": "Scientific article" },
{ "name": "Joan", "title": "Sports article" }
]
```
{
"author": {
"id": "rec_clfpfg8k22og0hc0bpsg",
"name": "Joan"
},
"id": "rec_clg721kcdi29f8llc22g",
"title": "Scientific article"
}
]
```

```jsonc
[
{ "name": "Alexis", "title": "Scientific article" },
{ "name": "Joan", "title": "Scientific article" },
{ "name": "Joan", "title": "Sports article" }
]
```

</TabbedCode>

</TabbedCode>
</details>

With this schema design, we keep in mind that there will be multiple records in the `posts` table for the same post, in order to associate it with multiple authors.

Expand Down

0 comments on commit 7071e9a

Please sign in to comment.