mirror of
https://github.com/hanzoai/sqlbuilder.git
synced 2026-10-01 00:37:42 +00:00
update doc
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user