-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed083d4
commit ebb4823
Showing
11 changed files
with
3,126 additions
and
1,202 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.