Skip to content

Commit 42de1ec

Browse files
committed
replace schema image with mermaid diagram
1 parent b676bb0 commit 42de1ec

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,30 @@ blogs := []Blog{}
2020
carta.Map(rows, &blogs)
2121
```
2222

23-
Assume that in the above example, we are using a schema containing has-one and has-many relationships:
24-
25-
![schema](https://i.ibb.co/SPH3zhQ/Schema.png)
23+
Assume that in the above example, we are using a schema containing has-one and has-many relationships, as illustrated in the diagram below:
24+
25+
```mermaid
26+
erDiagram
27+
blog ||--|| author : "has one"
28+
blog ||--o{ post : "has many"
29+
30+
blog {
31+
int id
32+
string title
33+
int author_id
34+
}
35+
36+
post {
37+
int id
38+
string name
39+
int blog_id
40+
}
41+
42+
author {
43+
int id
44+
string username
45+
}
46+
```
2647

2748
And here is our SQL query along with the corresponding Go struct:
2849
```

0 commit comments

Comments
 (0)