Documentation ¶
Index ¶
- Variables
- func AND(stmts ...Statement) *whereStmt
- func Alias(sql interface{}, alias string) *aliasStmt
- func Case(what ...interface{}) *caseStmt
- func Find(s Session, table string, dest interface{}, limit, offset int64, w Statement) (err error)
- func FindAll(s Session, table string, dest interface{}, w Statement) (err error)
- func FindOne(s Session, table string, dest interface{}, w Statement) (err error)
- func GetFields(dest interface{}) (result []string, err error)
- func NewSQL(driver, url string, maxOpen, maxIdle int) (db *sql.DB, err error)
- func NewStatement(sql interface{}, args ...interface{}) *statement
- func OR(stmts ...Statement) *whereStmt
- func OnDuplicateKeyUpdate() *onDuplicateKeyUpdateStmt
- func SQL(sql string, args ...interface{}) *statement
- func Scan(rows *sql.Rows, dest interface{}) (err error)
- func SetLogger(l Logger)
- func UseDialect(d dialect)
- type Buffer
- type Builder
- type DB
- type DBCache
- func (this *DBCache) Begin() (*sql.Tx, error)
- func (this *DBCache) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
- func (this *DBCache) Close() error
- func (this *DBCache) Exec(query string, args ...interface{}) (sql.Result, error)
- func (this *DBCache) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (this *DBCache) Ping() error
- func (this *DBCache) PingContext(ctx context.Context) error
- func (this *DBCache) Prepare(query string) (*sql.Stmt, error)
- func (this *DBCache) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func (this *DBCache) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (this *DBCache) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- type DeleteBuilder
- func (this *DeleteBuilder) Alias(alias ...string) *DeleteBuilder
- func (this *DeleteBuilder) Exec(s Session) (sql.Result, error)
- func (this *DeleteBuilder) ExecContext(ctx context.Context, s Session) (result sql.Result, err error)
- func (this *DeleteBuilder) Join(join, table, suffix string, args ...interface{}) *DeleteBuilder
- func (this *DeleteBuilder) LeftJoin(table, suffix string, args ...interface{}) *DeleteBuilder
- func (this *DeleteBuilder) Limit(limit int64) *DeleteBuilder
- func (this *DeleteBuilder) Offset(offset int64) *DeleteBuilder
- func (this *DeleteBuilder) Options(options ...string) *DeleteBuilder
- func (this *DeleteBuilder) OrderBy(sql ...string) *DeleteBuilder
- func (this *DeleteBuilder) Prefix(sql string, args ...interface{}) *DeleteBuilder
- func (this *DeleteBuilder) RightJoin(table, suffix string, args ...interface{}) *DeleteBuilder
- func (this *DeleteBuilder) Suffix(sql interface{}, args ...interface{}) *DeleteBuilder
- func (this *DeleteBuilder) Table(table string, args ...string) *DeleteBuilder
- func (this *DeleteBuilder) ToSQL() (string, []interface{}, error)
- func (this *DeleteBuilder) Type() string
- func (this *DeleteBuilder) USING(sql string) *DeleteBuilder
- func (this *DeleteBuilder) UseDialect(d dialect)
- func (this *DeleteBuilder) Where(sql interface{}, args ...interface{}) *DeleteBuilder
- func (this *DeleteBuilder) WriteToSQL(w Writer) (err error)
- type Eq
- type InsertBuilder
- func (this *InsertBuilder) Clone() *InsertBuilder
- func (this *InsertBuilder) Column(column string) *InsertBuilder
- func (this *InsertBuilder) Columns(columns ...string) *InsertBuilder
- func (this *InsertBuilder) Exec(s Session) (sql.Result, error)
- func (this *InsertBuilder) ExecContext(ctx context.Context, s Session) (result sql.Result, err error)
- func (this *InsertBuilder) Options(options ...string) *InsertBuilder
- func (this *InsertBuilder) Prefix(sql string, args ...interface{}) *InsertBuilder
- func (this *InsertBuilder) SET(column string, value interface{}) *InsertBuilder
- func (this *InsertBuilder) Select(sb *SelectBuilder) *InsertBuilder
- func (this *InsertBuilder) Suffix(sql interface{}, args ...interface{}) *InsertBuilder
- func (this *InsertBuilder) Table(table string) *InsertBuilder
- func (this *InsertBuilder) ToSQL() (string, []interface{}, error)
- func (this *InsertBuilder) Type() string
- func (this *InsertBuilder) UseDialect(d dialect)
- func (this *InsertBuilder) Values(values ...interface{}) *InsertBuilder
- func (this *InsertBuilder) WriteToSQL(w Writer) (err error)
- type Logger
- type MigrateRecord
- type Migration
- type NotEq
- type RawBuilder
- func (this *RawBuilder) Append(sql string, args ...interface{}) *RawBuilder
- func (this *RawBuilder) Exec(s Session) (sql.Result, error)
- func (this *RawBuilder) ExecContext(ctx context.Context, s Session) (result sql.Result, err error)
- func (this *RawBuilder) Format(format string, args ...interface{}) *RawBuilder
- func (this *RawBuilder) Params(args ...interface{}) *RawBuilder
- func (this *RawBuilder) Query(s Session) (*sql.Rows, error)
- func (this *RawBuilder) QueryContext(ctx context.Context, s Session) (*sql.Rows, error)
- func (this *RawBuilder) Scan(s Session, dest interface{}) (err error)
- func (this *RawBuilder) ScanContext(ctx context.Context, s Session, dest interface{}) (err error)
- func (this *RawBuilder) ScanRow(s Session, dest ...interface{}) (err error)
- func (this *RawBuilder) ScanRowContext(ctx context.Context, s Session, dest ...interface{}) (err error)
- func (this *RawBuilder) ToSQL() (string, []interface{}, error)
- func (this *RawBuilder) Type() string
- func (this *RawBuilder) UseDialect(d dialect)
- func (this *RawBuilder) WriteToSQL(w Writer) error
- type SQLValue
- type SelectBuilder
- func (this *SelectBuilder) Clone() *SelectBuilder
- func (this *SelectBuilder) Count(args ...string) *SelectBuilder
- func (this *SelectBuilder) FoundRows(args ...string) *SelectBuilder
- func (this *SelectBuilder) From(table string, args ...string) *SelectBuilder
- func (this *SelectBuilder) FromStmt(stmt Statement) *SelectBuilder
- func (this *SelectBuilder) GroupBy(groupBys ...string) *SelectBuilder
- func (this *SelectBuilder) Having(sql interface{}, args ...interface{}) *SelectBuilder
- func (this *SelectBuilder) Join(join, table, suffix string, args ...interface{}) *SelectBuilder
- func (this *SelectBuilder) LeftJoin(table, suffix string, args ...interface{}) *SelectBuilder
- func (this *SelectBuilder) Limit(limit int64) *SelectBuilder
- func (this *SelectBuilder) Offset(offset int64) *SelectBuilder
- func (this *SelectBuilder) Options(options ...string) *SelectBuilder
- func (this *SelectBuilder) OrderBy(sql ...string) *SelectBuilder
- func (this *SelectBuilder) Prefix(sql string, args ...interface{}) *SelectBuilder
- func (this *SelectBuilder) Query(s Session) (*sql.Rows, error)
- func (this *SelectBuilder) QueryContext(ctx context.Context, s Session) (*sql.Rows, error)
- func (this *SelectBuilder) RightJoin(table, suffix string, args ...interface{}) *SelectBuilder
- func (this *SelectBuilder) Scan(s Session, dest interface{}) (err error)
- func (this *SelectBuilder) ScanContext(ctx context.Context, s Session, dest interface{}) (err error)
- func (this *SelectBuilder) ScanRow(s Session, dest ...interface{}) (err error)
- func (this *SelectBuilder) ScanRowContext(ctx context.Context, s Session, dest ...interface{}) (err error)
- func (this *SelectBuilder) Select(column interface{}, args ...interface{}) *SelectBuilder
- func (this *SelectBuilder) Selects(columns ...string) *SelectBuilder
- func (this *SelectBuilder) Suffix(sql interface{}, args ...interface{}) *SelectBuilder
- func (this *SelectBuilder) ToSQL() (string, []interface{}, error)
- func (this *SelectBuilder) Type() string
- func (this *SelectBuilder) UseDialect(d dialect)
- func (this *SelectBuilder) UseSQLCalcFoundRows() *SelectBuilder
- func (this *SelectBuilder) Where(sql interface{}, args ...interface{}) *SelectBuilder
- func (this *SelectBuilder) WriteToSQL(w Writer) (err error)
- type Session
- type Statement
- type TX
- type UpdateBuilder
- func (this *UpdateBuilder) Exec(s Session) (sql.Result, error)
- func (this *UpdateBuilder) ExecContext(ctx context.Context, s Session) (result sql.Result, err error)
- func (this *UpdateBuilder) Join(join, table, suffix string, args ...interface{}) *UpdateBuilder
- func (this *UpdateBuilder) LeftJoin(table, suffix string, args ...interface{}) *UpdateBuilder
- func (this *UpdateBuilder) Limit(limit int64) *UpdateBuilder
- func (this *UpdateBuilder) Offset(offset int64) *UpdateBuilder
- func (this *UpdateBuilder) Options(options ...string) *UpdateBuilder
- func (this *UpdateBuilder) OrderBy(sql ...string) *UpdateBuilder
- func (this *UpdateBuilder) Prefix(sql string, args ...interface{}) *UpdateBuilder
- func (this *UpdateBuilder) RightJoin(table, suffix string, args ...interface{}) *UpdateBuilder
- func (this *UpdateBuilder) SET(column string, value interface{}) *UpdateBuilder
- func (this *UpdateBuilder) SETS(kvs ...interface{}) *UpdateBuilder
- func (this *UpdateBuilder) SetMap(data map[string]interface{}) *UpdateBuilder
- func (this *UpdateBuilder) Suffix(sql interface{}, args ...interface{}) *UpdateBuilder
- func (this *UpdateBuilder) Table(table string, args ...string) *UpdateBuilder
- func (this *UpdateBuilder) ToSQL() (string, []interface{}, error)
- func (this *UpdateBuilder) Type() string
- func (this *UpdateBuilder) UseDialect(d dialect)
- func (this *UpdateBuilder) Where(sql interface{}, args ...interface{}) *UpdateBuilder
- func (this *UpdateBuilder) WriteToSQL(w Writer) (err error)
- type Writer
Constants ¶
This section is empty.
Variables ¶
var ( MySQL = &mysql{} Default = MySQL PostgreSQL = &postgresql{} )
Functions ¶
func NewStatement ¶
func NewStatement(sql interface{}, args ...interface{}) *statement
func OnDuplicateKeyUpdate ¶
func OnDuplicateKeyUpdate() *onDuplicateKeyUpdateStmt
func UseDialect ¶
func UseDialect(d dialect)
Types ¶
type DBCache ¶ added in v1.0.6
type DBCache struct {
// contains filtered or unexported fields
}
func (*DBCache) ExecContext ¶ added in v1.0.6
func (*DBCache) PingContext ¶ added in v1.0.6
func (*DBCache) PrepareContext ¶ added in v1.0.6
type DeleteBuilder ¶
type DeleteBuilder struct {
// contains filtered or unexported fields
}
func NewDeleteBuilder ¶
func NewDeleteBuilder() *DeleteBuilder
func (*DeleteBuilder) Alias ¶
func (this *DeleteBuilder) Alias(alias ...string) *DeleteBuilder
func (*DeleteBuilder) ExecContext ¶
func (*DeleteBuilder) Join ¶
func (this *DeleteBuilder) Join(join, table, suffix string, args ...interface{}) *DeleteBuilder
func (*DeleteBuilder) LeftJoin ¶
func (this *DeleteBuilder) LeftJoin(table, suffix string, args ...interface{}) *DeleteBuilder
func (*DeleteBuilder) Limit ¶
func (this *DeleteBuilder) Limit(limit int64) *DeleteBuilder
func (*DeleteBuilder) Offset ¶
func (this *DeleteBuilder) Offset(offset int64) *DeleteBuilder
func (*DeleteBuilder) Options ¶
func (this *DeleteBuilder) Options(options ...string) *DeleteBuilder
func (*DeleteBuilder) OrderBy ¶
func (this *DeleteBuilder) OrderBy(sql ...string) *DeleteBuilder
func (*DeleteBuilder) Prefix ¶
func (this *DeleteBuilder) Prefix(sql string, args ...interface{}) *DeleteBuilder
func (*DeleteBuilder) RightJoin ¶
func (this *DeleteBuilder) RightJoin(table, suffix string, args ...interface{}) *DeleteBuilder
func (*DeleteBuilder) Suffix ¶
func (this *DeleteBuilder) Suffix(sql interface{}, args ...interface{}) *DeleteBuilder
func (*DeleteBuilder) Table ¶
func (this *DeleteBuilder) Table(table string, args ...string) *DeleteBuilder
func (*DeleteBuilder) ToSQL ¶
func (this *DeleteBuilder) ToSQL() (string, []interface{}, error)
func (*DeleteBuilder) Type ¶
func (this *DeleteBuilder) Type() string
func (*DeleteBuilder) USING ¶
func (this *DeleteBuilder) USING(sql string) *DeleteBuilder
func (*DeleteBuilder) UseDialect ¶
func (this *DeleteBuilder) UseDialect(d dialect)
func (*DeleteBuilder) Where ¶
func (this *DeleteBuilder) Where(sql interface{}, args ...interface{}) *DeleteBuilder
func (*DeleteBuilder) WriteToSQL ¶ added in v1.0.1
func (this *DeleteBuilder) WriteToSQL(w Writer) (err error)
type InsertBuilder ¶
type InsertBuilder struct {
// contains filtered or unexported fields
}
func Insert ¶
func Insert(columns ...string) *InsertBuilder
func NewInsertBuilder ¶
func NewInsertBuilder() *InsertBuilder
func (*InsertBuilder) Clone ¶
func (this *InsertBuilder) Clone() *InsertBuilder
func (*InsertBuilder) Column ¶
func (this *InsertBuilder) Column(column string) *InsertBuilder
func (*InsertBuilder) Columns ¶
func (this *InsertBuilder) Columns(columns ...string) *InsertBuilder
func (*InsertBuilder) ExecContext ¶
func (*InsertBuilder) Options ¶
func (this *InsertBuilder) Options(options ...string) *InsertBuilder
func (*InsertBuilder) Prefix ¶
func (this *InsertBuilder) Prefix(sql string, args ...interface{}) *InsertBuilder
func (*InsertBuilder) SET ¶
func (this *InsertBuilder) SET(column string, value interface{}) *InsertBuilder
func (*InsertBuilder) Select ¶
func (this *InsertBuilder) Select(sb *SelectBuilder) *InsertBuilder
func (*InsertBuilder) Suffix ¶
func (this *InsertBuilder) Suffix(sql interface{}, args ...interface{}) *InsertBuilder
func (*InsertBuilder) Table ¶
func (this *InsertBuilder) Table(table string) *InsertBuilder
func (*InsertBuilder) ToSQL ¶
func (this *InsertBuilder) ToSQL() (string, []interface{}, error)
func (*InsertBuilder) Type ¶
func (this *InsertBuilder) Type() string
func (*InsertBuilder) UseDialect ¶
func (this *InsertBuilder) UseDialect(d dialect)
func (*InsertBuilder) Values ¶
func (this *InsertBuilder) Values(values ...interface{}) *InsertBuilder
func (*InsertBuilder) WriteToSQL ¶ added in v1.0.1
func (this *InsertBuilder) WriteToSQL(w Writer) (err error)
type MigrateRecord ¶ added in v1.1.1
type Migration ¶ added in v1.1.1
type Migration struct {
// contains filtered or unexported fields
}
func NewMigration ¶ added in v1.1.1
type RawBuilder ¶
type RawBuilder struct {
// contains filtered or unexported fields
}
RawBuilder 原始 SQL 语句构造器,不会自动添加任何的关键字,主要是为了便于 SQL 语句及参数的管理。
func NewBuilder ¶
func NewBuilder(sql string, args ...interface{}) *RawBuilder
func (*RawBuilder) Append ¶
func (this *RawBuilder) Append(sql string, args ...interface{}) *RawBuilder
func (*RawBuilder) ExecContext ¶
func (*RawBuilder) Format ¶
func (this *RawBuilder) Format(format string, args ...interface{}) *RawBuilder
func (*RawBuilder) Params ¶
func (this *RawBuilder) Params(args ...interface{}) *RawBuilder
func (*RawBuilder) QueryContext ¶
func (*RawBuilder) Scan ¶
func (this *RawBuilder) Scan(s Session, dest interface{}) (err error)
func (*RawBuilder) ScanContext ¶
func (this *RawBuilder) ScanContext(ctx context.Context, s Session, dest interface{}) (err error)
func (*RawBuilder) ScanRow ¶
func (this *RawBuilder) ScanRow(s Session, dest ...interface{}) (err error)
func (*RawBuilder) ScanRowContext ¶
func (this *RawBuilder) ScanRowContext(ctx context.Context, s Session, dest ...interface{}) (err error)
func (*RawBuilder) ToSQL ¶
func (this *RawBuilder) ToSQL() (string, []interface{}, error)
func (*RawBuilder) Type ¶
func (this *RawBuilder) Type() string
func (*RawBuilder) UseDialect ¶
func (this *RawBuilder) UseDialect(d dialect)
func (*RawBuilder) WriteToSQL ¶ added in v1.0.1
func (this *RawBuilder) WriteToSQL(w Writer) error
type SelectBuilder ¶
type SelectBuilder struct {
// contains filtered or unexported fields
}
func NewSelectBuilder ¶
func NewSelectBuilder() *SelectBuilder
func Select ¶
func Select(columns ...string) *SelectBuilder
func (*SelectBuilder) Clone ¶
func (this *SelectBuilder) Clone() *SelectBuilder
func (*SelectBuilder) Count ¶
func (this *SelectBuilder) Count(args ...string) *SelectBuilder
func (*SelectBuilder) FoundRows ¶
func (this *SelectBuilder) FoundRows(args ...string) *SelectBuilder
func (*SelectBuilder) From ¶
func (this *SelectBuilder) From(table string, args ...string) *SelectBuilder
func (*SelectBuilder) FromStmt ¶
func (this *SelectBuilder) FromStmt(stmt Statement) *SelectBuilder
func (*SelectBuilder) GroupBy ¶
func (this *SelectBuilder) GroupBy(groupBys ...string) *SelectBuilder
func (*SelectBuilder) Having ¶
func (this *SelectBuilder) Having(sql interface{}, args ...interface{}) *SelectBuilder
func (*SelectBuilder) Join ¶
func (this *SelectBuilder) Join(join, table, suffix string, args ...interface{}) *SelectBuilder
func (*SelectBuilder) LeftJoin ¶
func (this *SelectBuilder) LeftJoin(table, suffix string, args ...interface{}) *SelectBuilder
func (*SelectBuilder) Limit ¶
func (this *SelectBuilder) Limit(limit int64) *SelectBuilder
func (*SelectBuilder) Offset ¶
func (this *SelectBuilder) Offset(offset int64) *SelectBuilder
func (*SelectBuilder) Options ¶
func (this *SelectBuilder) Options(options ...string) *SelectBuilder
func (*SelectBuilder) OrderBy ¶
func (this *SelectBuilder) OrderBy(sql ...string) *SelectBuilder
func (*SelectBuilder) Prefix ¶
func (this *SelectBuilder) Prefix(sql string, args ...interface{}) *SelectBuilder
func (*SelectBuilder) QueryContext ¶
func (*SelectBuilder) RightJoin ¶
func (this *SelectBuilder) RightJoin(table, suffix string, args ...interface{}) *SelectBuilder
func (*SelectBuilder) Scan ¶
func (this *SelectBuilder) Scan(s Session, dest interface{}) (err error)
Scan 读取数据到一个结构体中。 需要注意:声明变量的时候,变量应该为某一结构体的指针类型,不需要初始化,调用 Scan() 方法的时候,需要传递变量的地址。 var user *User
var sb = dbs.NewSelectBuilder() sb.Scan(db, &user)
func (*SelectBuilder) ScanContext ¶
func (this *SelectBuilder) ScanContext(ctx context.Context, s Session, dest interface{}) (err error)
ScanContext 读取数据到一个结构体中。 需要注意:声明变量的时候,变量应该为某一结构体的指针类型,不需要初始化,调用 ScanContext() 方法的时候,需要传递变量的地址。 var user *User
var sb = dbs.NewSelectBuilder() sb.ScanContext(ctx, db, &user)
func (*SelectBuilder) ScanRow ¶
func (this *SelectBuilder) ScanRow(s Session, dest ...interface{}) (err error)
ScanRow 读取数据到基本数据类型的变量中,类似于 database/sql 包中结构体 Rows 的 Scan() 方法。 var name string var age int
var sb = dbs.NewSelectBuilder() sb.ScanRow(db, &name, &age)
func (*SelectBuilder) ScanRowContext ¶
func (this *SelectBuilder) ScanRowContext(ctx context.Context, s Session, dest ...interface{}) (err error)
ScanRowContext 读取数据到基本数据类型的变量中,类似于 database/sql 包中结构体 Rows 的 Scan() 方法。 var name string var age int
var sb = dbs.NewSelectBuilder() sb.ScanRowContext(ctx, db, &name, &age)
func (*SelectBuilder) Select ¶
func (this *SelectBuilder) Select(column interface{}, args ...interface{}) *SelectBuilder
func (*SelectBuilder) Selects ¶
func (this *SelectBuilder) Selects(columns ...string) *SelectBuilder
func (*SelectBuilder) Suffix ¶
func (this *SelectBuilder) Suffix(sql interface{}, args ...interface{}) *SelectBuilder
func (*SelectBuilder) ToSQL ¶
func (this *SelectBuilder) ToSQL() (string, []interface{}, error)
func (*SelectBuilder) Type ¶
func (this *SelectBuilder) Type() string
func (*SelectBuilder) UseDialect ¶
func (this *SelectBuilder) UseDialect(d dialect)
func (*SelectBuilder) UseSQLCalcFoundRows ¶
func (this *SelectBuilder) UseSQLCalcFoundRows() *SelectBuilder
func (*SelectBuilder) Where ¶
func (this *SelectBuilder) Where(sql interface{}, args ...interface{}) *SelectBuilder
func (*SelectBuilder) WriteToSQL ¶ added in v1.0.1
func (this *SelectBuilder) WriteToSQL(w Writer) (err error)
type Session ¶ added in v1.0.4
type Session interface { Exec(query string, args ...interface{}) (sql.Result, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) Prepare(query string) (*sql.Stmt, error) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) }
type TX ¶
type TX interface { DB // Id 获取事务 id Id() string // String 返回事务描述 String() string // Trace 添加日志信息 Trace(string) // Commit 提交事务 Commit() (err error) // Rollback 回滚事务 Rollback() error Stmt(stmt *sql.Stmt) *sql.Stmt StmtContext(ctx context.Context, stmt *sql.Stmt) *sql.Stmt // contains filtered or unexported methods }
type UpdateBuilder ¶
type UpdateBuilder struct {
// contains filtered or unexported fields
}
func NewUpdateBuilder ¶
func NewUpdateBuilder() *UpdateBuilder
func Update ¶
func Update(table string, args ...string) *UpdateBuilder
func (*UpdateBuilder) ExecContext ¶
func (*UpdateBuilder) Join ¶
func (this *UpdateBuilder) Join(join, table, suffix string, args ...interface{}) *UpdateBuilder
func (*UpdateBuilder) LeftJoin ¶
func (this *UpdateBuilder) LeftJoin(table, suffix string, args ...interface{}) *UpdateBuilder
func (*UpdateBuilder) Limit ¶
func (this *UpdateBuilder) Limit(limit int64) *UpdateBuilder
func (*UpdateBuilder) Offset ¶
func (this *UpdateBuilder) Offset(offset int64) *UpdateBuilder
func (*UpdateBuilder) Options ¶
func (this *UpdateBuilder) Options(options ...string) *UpdateBuilder
func (*UpdateBuilder) OrderBy ¶
func (this *UpdateBuilder) OrderBy(sql ...string) *UpdateBuilder
func (*UpdateBuilder) Prefix ¶
func (this *UpdateBuilder) Prefix(sql string, args ...interface{}) *UpdateBuilder
func (*UpdateBuilder) RightJoin ¶
func (this *UpdateBuilder) RightJoin(table, suffix string, args ...interface{}) *UpdateBuilder
func (*UpdateBuilder) SET ¶
func (this *UpdateBuilder) SET(column string, value interface{}) *UpdateBuilder
func (*UpdateBuilder) SETS ¶
func (this *UpdateBuilder) SETS(kvs ...interface{}) *UpdateBuilder
SETS 批量设置需要更新的字段及其值 var name = "my name" SETS("name", name, "age", 10)
func (*UpdateBuilder) SetMap ¶
func (this *UpdateBuilder) SetMap(data map[string]interface{}) *UpdateBuilder
func (*UpdateBuilder) Suffix ¶
func (this *UpdateBuilder) Suffix(sql interface{}, args ...interface{}) *UpdateBuilder
func (*UpdateBuilder) Table ¶
func (this *UpdateBuilder) Table(table string, args ...string) *UpdateBuilder
func (*UpdateBuilder) ToSQL ¶
func (this *UpdateBuilder) ToSQL() (string, []interface{}, error)
func (*UpdateBuilder) Type ¶
func (this *UpdateBuilder) Type() string
func (*UpdateBuilder) UseDialect ¶
func (this *UpdateBuilder) UseDialect(d dialect)
func (*UpdateBuilder) Where ¶
func (this *UpdateBuilder) Where(sql interface{}, args ...interface{}) *UpdateBuilder
func (*UpdateBuilder) WriteToSQL ¶ added in v1.0.1
func (this *UpdateBuilder) WriteToSQL(w Writer) (err error)