You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ fmt.Println(sql)
52
52
// SELECT id, name FROM demo.user WHERE status = 1 LIMIT 10
53
53
```
54
54
55
-
In the most cases, we need to escape all input from user. In this case, create a builder before starting.
55
+
In the most common cases, we need to escape all input from user. In this case, create a builder before starting.
56
56
57
57
```go
58
58
sb := sqlbuilder.NewSelectBuilder()
@@ -222,7 +222,7 @@ type ATable struct {
222
222
Field1 string // If a field doesn't has a tag, use "Field1" as column name in SQL.
223
223
Field2 int `db:"field2"` // Use "db" in field tag to set column name used in SQL.
224
224
Field3 int64 `db:"field3" fieldtag:"foo,bar"` // Set fieldtag to a field. We can call `WithTag` to include fields with tag or `WithoutTag` to exclude fields with tag.
225
-
Field4 int64 `db:"field4" fieldtag:"foo"` // If we use `s.WithTag("foo").Select(table)`, columnes of SELECT are field3 and field4.
225
+
Field4 int64 `db:"field4" fieldtag:"foo"` // If we use `s.WithTag("foo").Select("t")`, columnes of SELECT are "t.field3" and "t.field4".
226
226
Field5 string `db:"field5" fieldas:"f5_alias"` // Use "fieldas" in field tag to set a column alias (AS) used in SELECT.
227
227
Ignored int32 `db:"-"` // If we set field name as "-", Struct will ignore it.
228
228
unexported int // Unexported field is not visible to Struct.
@@ -232,6 +232,10 @@ type ATable struct {
232
232
// The `omitempty` can be written as a function.
233
233
// In this case, omit empty field `Tagged` when UPDATE for tag `tag1` and `tag3` but not `tag2`.
0 commit comments