File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,30 @@ blogs := []Blog{}
2020carta.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
2748And here is our SQL query along with the corresponding Go struct:
2849```
You can’t perform that action at this time.
0 commit comments