Documentation ¶
Index ¶
- Variables
- func Create(dbCtx lib.DBContexter, table string, data ...interface{}) (int64, error)
- func Delete(dbCtx lib.DBContexter, table string, where interface{}) (int64, error)
- func QueryList(dbCtx lib.DBContexter, table string, where interface{}, rst interface{}) error
- func QueryOne(dbCtx lib.DBContexter, table string, where interface{}, rst interface{}) error
- func Struct2Assign(raw interface{}) map[string]interface{}
- func Struct2AssignList(raws ...interface{}) []map[string]interface{}
- func Struct2Where(raw interface{}) map[string]interface{}
- func Update(dbCtx lib.DBContexter, table string, where interface{}, data interface{}) (int64, error)
- type DeleteBuilder
- type InsertBuilder
- func (i *InsertBuilder) Compile() (sql string, args []interface{}, err error)
- func (i *InsertBuilder) InsertIgnoreInto(table string) *InsertBuilder
- func (i *InsertBuilder) InsertInto(table string) *InsertBuilder
- func (i *InsertBuilder) ReplaceInto(table string) *InsertBuilder
- func (i *InsertBuilder) Values(assigns []map[string]interface{}) *InsertBuilder
- type SQLBuilder
- func NewDeleteBuilder(table string, wheres map[string]interface{}) SQLBuilder
- func NewIgnoreInsertBuilder(table string, assigns []map[string]interface{}) SQLBuilder
- func NewInsertBuilder(table string, assigns []map[string]interface{}) SQLBuilder
- func NewReplaceInsertBuilder(table string, assigns []map[string]interface{}) SQLBuilder
- func NewSelectBuilder(table string, where map[string]interface{}, fields []string) SQLBuilder
- func NewUpdateBuilder(table string, wheres map[string]interface{}, assigns map[string]interface{}) SQLBuilder
- type SelectBuilder
- type UpdateBuilder
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PInt64 = lib.PInt64 PUint32 = lib.PUint32 PInt32 = lib.PInt32 PInt8 = lib.PInt8 PInt = lib.PInt PBool = lib.PBool PTime = lib.PTime PTimeNow = lib.PTimeNow )
View Source
var ErrRecordNotFound = sql.ErrNoRows
View Source
var ErrWrap = xerror.WrapDaoError
Functions ¶
func QueryList ¶
func QueryList(dbCtx lib.DBContexter, table string, where interface{}, rst interface{}) error
func QueryOne ¶
func QueryOne(dbCtx lib.DBContexter, table string, where interface{}, rst interface{}) error
func Struct2Assign ¶
func Struct2Assign(raw interface{}) map[string]interface{}
func Struct2AssignList ¶
func Struct2AssignList(raws ...interface{}) []map[string]interface{}
func Struct2Where ¶
func Struct2Where(raw interface{}) map[string]interface{}
Types ¶
type DeleteBuilder ¶
type DeleteBuilder struct {
// contains filtered or unexported fields
}
func (*DeleteBuilder) Compile ¶
func (d *DeleteBuilder) Compile() (sql string, args []interface{}, err error)
func (*DeleteBuilder) From ¶
func (d *DeleteBuilder) From(table string) *DeleteBuilder
func (*DeleteBuilder) Where ¶
func (d *DeleteBuilder) Where(wheres map[string]interface{}) *DeleteBuilder
type InsertBuilder ¶
type InsertBuilder struct {
// contains filtered or unexported fields
}
func (*InsertBuilder) Compile ¶
func (i *InsertBuilder) Compile() (sql string, args []interface{}, err error)
func (*InsertBuilder) InsertIgnoreInto ¶
func (i *InsertBuilder) InsertIgnoreInto(table string) *InsertBuilder
func (*InsertBuilder) InsertInto ¶
func (i *InsertBuilder) InsertInto(table string) *InsertBuilder
func (*InsertBuilder) ReplaceInto ¶
func (i *InsertBuilder) ReplaceInto(table string) *InsertBuilder
func (*InsertBuilder) Values ¶
func (i *InsertBuilder) Values(assigns []map[string]interface{}) *InsertBuilder
type SQLBuilder ¶
func NewDeleteBuilder ¶
func NewDeleteBuilder(table string, wheres map[string]interface{}) SQLBuilder
func NewIgnoreInsertBuilder ¶
func NewIgnoreInsertBuilder(table string, assigns []map[string]interface{}) SQLBuilder
func NewInsertBuilder ¶
func NewInsertBuilder(table string, assigns []map[string]interface{}) SQLBuilder
func NewReplaceInsertBuilder ¶
func NewReplaceInsertBuilder(table string, assigns []map[string]interface{}) SQLBuilder
func NewSelectBuilder ¶
func NewSelectBuilder(table string, where map[string]interface{}, fields []string) SQLBuilder
func NewUpdateBuilder ¶
func NewUpdateBuilder(table string, wheres map[string]interface{}, assigns map[string]interface{}) SQLBuilder
type SelectBuilder ¶
type SelectBuilder struct {
// contains filtered or unexported fields
}
func (*SelectBuilder) Compile ¶
func (s *SelectBuilder) Compile() (sql string, args []interface{}, err error)
func (*SelectBuilder) From ¶
func (s *SelectBuilder) From(table string) *SelectBuilder
func (*SelectBuilder) Select ¶
func (s *SelectBuilder) Select(selectFields []string) *SelectBuilder
func (*SelectBuilder) Where ¶
func (s *SelectBuilder) Where(wheres map[string]interface{}) *SelectBuilder
type UpdateBuilder ¶
type UpdateBuilder struct {
// contains filtered or unexported fields
}
func (*UpdateBuilder) Assign ¶
func (u *UpdateBuilder) Assign(assign map[string]interface{}) *UpdateBuilder
func (*UpdateBuilder) Compile ¶
func (u *UpdateBuilder) Compile() (sql string, args []interface{}, err error)
func (*UpdateBuilder) From ¶
func (u *UpdateBuilder) From(table string) *UpdateBuilder
func (*UpdateBuilder) Where ¶
func (u *UpdateBuilder) Where(wheres map[string]interface{}) *UpdateBuilder
Click to show internal directories.
Click to hide internal directories.