Documentation ¶
Index ¶
- type DB
- func (d *DB) Begin() DB
- func (d *DB) Close()
- func (d *DB) Commit()
- func (d *DB) Connect(dialect string, connection string, once ...bool) *DB
- func (d *DB) Delete(table string) *QueryBuilder
- func (d *DB) DeleteBy(table string, column string, value interface{}) *QueryBuilder
- func (d *DB) DeleteById(table string, id interface{}) *QueryBuilder
- func (d *DB) Exec(query ...string) ExecResponse
- func (d *DB) Find(table string) *QueryBuilder
- func (d *DB) FindBy(table string, column string, value interface{}) *QueryBuilder
- func (d *DB) FindById(table string, id interface{}) *QueryBuilder
- func (d *DB) GetIDName(tableName ...string) string
- func (d *DB) Insert(table string, columns sqlq.Map) *QueryBuilder
- func (d *DB) Query(query string, model ...Model) Table
- func (d *DB) QueryRow(query string, model ...Model) TableRow
- func (d *DB) Reconnect()
- func (d *DB) Rollback()
- func (d *DB) Update(table string, columns sqlq.Map, upsert ...bool) *QueryBuilder
- func (d *DB) UpdateBy(table string, column string, value interface{}, columns sqlq.Map, ...) *QueryBuilder
- func (d *DB) UpdateById(table string, id interface{}, columns sqlq.Map, upsert ...bool) *QueryBuilder
- func (d *DB) UpdateByIdOne(table string, id interface{}, column string, value interface{}, upsert ...bool) *QueryBuilder
- func (d *DB) UpdateOne(table string, column string, value interface{}, upsert ...bool) *QueryBuilder
- type ExecResponse
- type Model
- type ModelParams
- type QueryBuilder
- func (qb *QueryBuilder) AddUpdate(column string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) AddUpsertInsert(column string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) AddtInsert(column string, value interface{}) *QueryBuilder
- func (qb *QueryBuilder) Count() int
- func (qb *QueryBuilder) Exec() ExecResponse
- func (qb *QueryBuilder) Exist() bool
- func (qb *QueryBuilder) GetAll(model ...Model) Table
- func (qb *QueryBuilder) GetOne(model ...Model) TableRow
- func (qb *QueryBuilder) GetOneWithErr() (TableRow, error)
- func (qb *QueryBuilder) GroupBy(columns ...interface{}) *QueryBuilder
- func (qb *QueryBuilder) Join(table interface{}, table1Column interface{}, table2Column interface{}) *QueryBuilder
- func (qb *QueryBuilder) LeftJoin(table interface{}, table1Column interface{}, table2Column interface{}) *QueryBuilder
- func (qb *QueryBuilder) Limit(value int) *QueryBuilder
- func (qb *QueryBuilder) Offset(value int) *QueryBuilder
- func (qb *QueryBuilder) Order(column interface{}, order string) *QueryBuilder
- func (qb *QueryBuilder) Paginate(page, perPage int) *QueryBuilder
- func (qb *QueryBuilder) RemoveUpdate(column string) *QueryBuilder
- func (qb *QueryBuilder) RemoveUpsertInsert(column string) *QueryBuilder
- func (qb *QueryBuilder) RemovetInsert(column string) *QueryBuilder
- func (qb *QueryBuilder) Select(columns ...interface{}) *QueryBuilder
- func (qb *QueryBuilder) SelectDistinct(columns ...interface{}) *QueryBuilder
- func (qb *QueryBuilder) SelectDistinctModel(model Model) *QueryBuilder
- func (qb *QueryBuilder) SelectModel(model Model) *QueryBuilder
- func (qb *QueryBuilder) Where(conditions ...string) *QueryBuilder
- func (qb *QueryBuilder) WhereOr(conditions ...string) *QueryBuilder
- type Table
- type TableRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { SQLQ *sqlq.Sqlq IDName string // {{tableName}}_id IDWithTableName bool Db *sql.DB Tx *sql.Tx TxError error Debug bool Dialect string Connection string Error error IsDBError bool Once bool Closed bool MysqlTextProtocol bool DefaultTimeString string }
func (*DB) Delete ¶
func (d *DB) Delete(table string) *QueryBuilder
func (*DB) DeleteBy ¶
func (d *DB) DeleteBy(table string, column string, value interface{}) *QueryBuilder
func (*DB) DeleteById ¶
func (d *DB) DeleteById(table string, id interface{}) *QueryBuilder
func (*DB) Exec ¶
func (d *DB) Exec(query ...string) ExecResponse
func (*DB) FindBy ¶
func (d *DB) FindBy(table string, column string, value interface{}) *QueryBuilder
func (*DB) FindById ¶
func (d *DB) FindById(table string, id interface{}) *QueryBuilder
func (*DB) Update ¶
func (*DB) UpdateBy ¶
func (*DB) UpdateById ¶
type Model ¶
type Model map[string]ModelParams
type ModelParams ¶
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
func (*QueryBuilder) AddUpdate ¶
func (qb *QueryBuilder) AddUpdate(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) AddUpsertInsert ¶
func (qb *QueryBuilder) AddUpsertInsert(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) AddtInsert ¶
func (qb *QueryBuilder) AddtInsert(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) Count ¶
func (qb *QueryBuilder) Count() int
func (*QueryBuilder) Exec ¶
func (qb *QueryBuilder) Exec() ExecResponse
func (*QueryBuilder) Exist ¶
func (qb *QueryBuilder) Exist() bool
func (*QueryBuilder) GetAll ¶
func (qb *QueryBuilder) GetAll(model ...Model) Table
func (*QueryBuilder) GetOne ¶
func (qb *QueryBuilder) GetOne(model ...Model) TableRow
func (*QueryBuilder) GetOneWithErr ¶
func (qb *QueryBuilder) GetOneWithErr() (TableRow, error)
func (*QueryBuilder) GroupBy ¶
func (qb *QueryBuilder) GroupBy(columns ...interface{}) *QueryBuilder
func (*QueryBuilder) Join ¶
func (qb *QueryBuilder) Join(table interface{}, table1Column interface{}, table2Column interface{}) *QueryBuilder
func (*QueryBuilder) LeftJoin ¶
func (qb *QueryBuilder) LeftJoin(table interface{}, table1Column interface{}, table2Column interface{}) *QueryBuilder
func (*QueryBuilder) Limit ¶
func (qb *QueryBuilder) Limit(value int) *QueryBuilder
func (*QueryBuilder) Offset ¶
func (qb *QueryBuilder) Offset(value int) *QueryBuilder
func (*QueryBuilder) Order ¶
func (qb *QueryBuilder) Order(column interface{}, order string) *QueryBuilder
func (*QueryBuilder) Paginate ¶
func (qb *QueryBuilder) Paginate(page, perPage int) *QueryBuilder
func (*QueryBuilder) RemoveUpdate ¶
func (qb *QueryBuilder) RemoveUpdate(column string) *QueryBuilder
func (*QueryBuilder) RemoveUpsertInsert ¶
func (qb *QueryBuilder) RemoveUpsertInsert(column string) *QueryBuilder
func (*QueryBuilder) RemovetInsert ¶
func (qb *QueryBuilder) RemovetInsert(column string) *QueryBuilder
func (*QueryBuilder) Select ¶
func (qb *QueryBuilder) Select(columns ...interface{}) *QueryBuilder
func (*QueryBuilder) SelectDistinct ¶
func (qb *QueryBuilder) SelectDistinct(columns ...interface{}) *QueryBuilder
func (*QueryBuilder) SelectDistinctModel ¶
func (qb *QueryBuilder) SelectDistinctModel(model Model) *QueryBuilder
func (*QueryBuilder) SelectModel ¶
func (qb *QueryBuilder) SelectModel(model Model) *QueryBuilder
func (*QueryBuilder) Where ¶
func (qb *QueryBuilder) Where(conditions ...string) *QueryBuilder
func (*QueryBuilder) WhereOr ¶
func (qb *QueryBuilder) WhereOr(conditions ...string) *QueryBuilder
type Table ¶
type Table []TableRow
func (Table) ToJSON ¶
ToJSON for rename use `rowName AS newRowName`
Click to show internal directories.
Click to hide internal directories.