update doc

This commit is contained in:
Huan Du
2017-12-31 01:57:03 +08:00
parent ec2d60bdf3
commit ff11beaf50
2 changed files with 5 additions and 10 deletions
+2 -7
View File
@@ -121,13 +121,8 @@ sb.Select("id")
sb.From(sb.As(fmt.Sprintf("(%v)", sb.Var(fromSb), "user")))
sb.Where(sb.In("status", statusSb))
fromSb.Select("id")
fromSb.From("user")
fromSb.Where(sb.G("level", 4))
statusSb.Select("status")
statusSb.From("config")
statusSb.Where(sb.E("state", 1))
fromSb.Select("id").From("user").Where(fromSb.GreaterThan("level", 4))
statusSb.Select("status").From("config").Where(statusSb.Equal("state", 1))
sql, args := sb.Build()
fmt.Println(sql)
+3 -3
View File
@@ -228,13 +228,13 @@ func (s *Struct) DeleteFrom(table string) *DeleteBuilder {
return db
}
// Addr take address of all exported fields of the s from the value.
// Addr takes address of all exported fields of the s from the value.
// The returned result can be used in `Row#Scan` directly.
func (s *Struct) Addr(value interface{}) []interface{} {
return s.AddrForTag("", value)
}
// AddrForTag take address of all fields of the s tagged with tag from the value.
// AddrForTag takes address of all fields of the s tagged with tag from the value.
// The returned result can be used in `Row#Scan` directly.
//
// If tag is not defined in s in advance,
@@ -248,7 +248,7 @@ func (s *Struct) AddrForTag(tag string, value interface{}) []interface{} {
return s.AddrWithCols(fields, value)
}
// AddrWithCols take address of all columns defined in cols from the value.
// AddrWithCols takes address of all columns defined in cols from the value.
// The returned result can be used in `Row#Scan` directly.
func (s *Struct) AddrWithCols(cols []string, value interface{}) []interface{} {
v := dereferencedValue(value)