Skip to content

Commit

Permalink
0.9.23
Browse files Browse the repository at this point in the history
  • Loading branch information
babyfish-ct committed Dec 1, 2024
1 parent ed083d4 commit ebb4823
Show file tree
Hide file tree
Showing 11 changed files with 3,126 additions and 1,202 deletions.
528 changes: 0 additions & 528 deletions docs/mutation/save-command/associated-save-mode.mdx

This file was deleted.

45 changes: 45 additions & 0 deletions docs/mutation/save-command/association/_dissociate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<table>
<thead>
<tr>
<th>Existing Database Structure</th>
<th>User's Expected Data Structure</th>
</tr>
</thead>
<tbody>
<tr>
<td>

```sh
+-Food
|
|
|
# highlight-next-line
+-----Meat(ignore child nodes)
|
\-----Bread(ignore child nodes)
```

</td>
<td>

```sh
+-Food
|
+-----Drinks(ignore child nodes)
|
|
|
\-----Bread(ignore child nodes)
```

</td>
</tr>
</tbody>
</table>

- For `Bread`, it exists in both old and new data structures, corresponding to an UPDATE operation

- For `Drinks`, it doesn't exist in the old data structure but exists in the new data, corresponding to an INSERT operation

- For `Meat`, it exists in the old data structure but not in the new data, corresponding to an operation called dissociation operation.
48 changes: 48 additions & 0 deletions docs/mutation/save-command/association/_merge-roots.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<details>
<summary>Saving the root object is not the focus of this article, collapsed by default</summary>
<Tabs groupId="database">
<TabItem value="h2" label="H2">

```sql
merge into BOOK_STORE(
NAME
) key(NAME) values(
?
)
/* batch-0: [MANNING] */
/* batch-1: [AMAZON] */
```

</TabItem>
<TabItem value="mysql" label="Mysql">

```
TBD
```

</TabItem>
<TabItem value="posgres" label="Postgres">

```sql
insert into BOOK_STORE(
NAME
) values(
?
) on conflict(
NAME
) do nothing
returning ID
/* batch-0: [MANNING] */
/* batch-1: [AMAZON] */
```

</TabItem>
</Tabs>

- Assume `MANNING` exists with an id of `2`
- Assume `AMAZON` exists, after insertion, the database automatically assigns a new id of `100`

</details>
Loading

0 comments on commit ebb4823

Please sign in to comment.