Documentation ¶
Index ¶
- type DBO
- func (dbo *DBO) Delete(ctx context.Context, tx *sql.Tx, table string, where []Where) (sql.Result, error)
- func (dbo *DBO) Excute(ctx context.Context, stmt *sql.Stmt, fields []Feild) (sql.Result, error)
- func (dbo *DBO) Exec(ctx context.Context, tx *sql.Tx, query string, args ...any) (sql.Result, error)
- func (dbo *DBO) Insert(ctx context.Context, tx *sql.Tx, table string, fields []Feild) (sql.Result, error)
- func (dbo *DBO) Prepare(ctx context.Context, tx *sql.Tx, table string, fields []Feild) (*sql.Stmt, error)
- func (dbo *DBO) SelectRawSQL(ctx context.Context, table string, sqlStr string, values []interface{}, ...) error
- func (dbo *DBO) SelectRows(ctx context.Context, table string, cols []string, where []Where, order *Order, ...) error
- func (dbo *DBO) SelectRowsOffset(ctx context.Context, table string, cols []string, where []Where, order *Order, ...) error
- func (dbo *DBO) SelectRowsToMaps(ctx context.Context, table string, cols []string, where []Where, order *Order, ...) ([]map[string]interface{}, error)
- func (dbo *DBO) SelectRowsUnion(ctx context.Context, table string, cols []string, wheres [][]Where, ...) error
- func (dbo *DBO) SelectRowsUnionToMaps(ctx context.Context, table string, cols []string, wheres [][]Where, ...) ([]map[string]interface{}, error)
- func (dbo *DBO) Transaction(fn func(tx *sql.Tx) error) error
- func (dbo *DBO) Update(ctx context.Context, tx *sql.Tx, table string, toupdate []Feild, where []Where) (sql.Result, error)
- type Feild
- type Order
- type Paging
- type Where
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBO ¶
type DBO struct {
// contains filtered or unexported fields
}
func (*DBO) Delete ¶
func (dbo *DBO) Delete(ctx context.Context, tx *sql.Tx, table string, where []Where) (sql.Result, error)
Delete delete records
func (*DBO) SelectRawSQL ¶
func (dbo *DBO) SelectRawSQL(ctx context.Context, table string, sqlStr string, values []interface{}, result interface{}) error
SelectRawSQL query useing raw sql
func (*DBO) SelectRows ¶
func (dbo *DBO) SelectRows(ctx context.Context, table string, cols []string, where []Where, order *Order, paging *Paging, result interface{}) error
SelectRows select rows to struct slice
func (*DBO) SelectRowsOffset ¶
func (dbo *DBO) SelectRowsOffset(ctx context.Context, table string, cols []string, where []Where, order *Order, offset, limit uint64, result interface{}) error
SelectRowsOffset select rows to struct slice
func (*DBO) SelectRowsToMaps ¶
func (dbo *DBO) SelectRowsToMaps(ctx context.Context, table string, cols []string, where []Where, order *Order, paging *Paging) ([]map[string]interface{}, error)
SelectRowsToMaps select rows to map slice
func (*DBO) SelectRowsUnion ¶
func (*DBO) SelectRowsUnionToMaps ¶ added in v0.1.8
Click to show internal directories.
Click to hide internal directories.