We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 126d9f7 commit e81af3fCopy full SHA for e81af3f
structs_test.go
@@ -0,0 +1,21 @@
1
+package carta
2
+
3
+// Label represents a label associated with a blog post.
4
+type Label struct {
5
+ ID *int `db:"id"`
6
+ Name *string `db:"name"`
7
+}
8
9
+// PostWithLabels represents a blog post that has multiple labels.
10
+type PostWithLabels struct {
11
+ ID int `db:"id"`
12
+ Title string `db:"title"`
13
+ Labels []Label `carta:"labels"`
14
15
16
+// BlogWithPosts represents a blog that has multiple posts.
17
+type BlogWithPosts struct {
18
19
+ Name string `db:"name"`
20
+ Posts []PostWithLabels `carta:"posts"`
21
0 commit comments