Documentation ¶
Index ¶
- Variables
- func DBErr(err error) *dbErr
- func Scan(rows *sql.Rows, v interface{}) error
- type DB
- func (d *DB) Begin() (*DB, error)
- func (d *DB) Commit() error
- func (d *DB) ExecExpr(expr builder.SqlExpr) (sql.Result, error)
- func (d *DB) IsTx() bool
- func (d *DB) QueryExpr(expr builder.SqlExpr) (*sql.Rows, error)
- func (d *DB) QueryExprAndScan(expr builder.SqlExpr, v interface{}) error
- func (d *DB) Rollback() error
- func (d *DB) SetConnMaxLifetime(t time.Duration)
- func (d *DB) SetMaxIdleConns(n int)
- func (d *DB) SetMaxOpenConns(n int)
- func (d DB) WithSchema(schema string) *DB
- type DBNameBinder
- type Database
- func (database *Database) AddTable(table *builder.Table)
- func (database *Database) Assignments(model builder.Model, zeroFields ...string) builder.Assignments
- func (database *Database) FieldValuesFromModel(table *builder.Table, model builder.Model, zeroFields ...string) builder.FieldValues
- func (database *Database) Insert(model builder.Model, zeroFields []string, additions ...builder.Addition) builder.SqlExpr
- func (database *Database) OpenDB(connector driver.Connector) *DB
- func (database *Database) Register(model builder.Model) *builder.Table
- func (database *Database) T(model builder.Model) *builder.Table
- func (database *Database) Table(tableName string) *builder.Table
- func (database Database) WithSchema(schema string) *Database
- type SqlError
- type SqlExecutor
- type Task
- type Tasks
Constants ¶
This section is empty.
Variables ¶
View Source
var DuplicateEntryErrNumber uint16 = 1062
View Source
var ErrNotDB = errors.New("db is not *sql.DB")
View Source
var ErrNotTx = errors.New("db is not *sql.Tx")
Functions ¶
Types ¶
type DB ¶
type DB struct { *Database builder.Dialect SqlExecutor }
func (*DB) QueryExprAndScan ¶
func (*DB) SetConnMaxLifetime ¶
func (*DB) SetMaxIdleConns ¶
func (*DB) SetMaxOpenConns ¶
func (DB) WithSchema ¶ added in v2.2.2
type DBNameBinder ¶
type Database ¶
func NewDatabase ¶
func NewFeatureDatabase ¶
func (*Database) Assignments ¶
func (*Database) FieldValuesFromModel ¶
func (Database) WithSchema ¶ added in v2.2.2
type SqlExecutor ¶
Click to show internal directories.
Click to hide internal directories.