sqlx

package
v3.15.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2018 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbController

type DbController struct {
	// contains filtered or unexported fields
}

func NewDbController

func NewDbController(newSqlxDb *sqlx.DB) *DbController

func (*DbController) BindNamed

func (ctrl *DbController) BindNamed(query string, arg interface{}) (string, []interface{})

func (*DbController) Get

func (ctrl *DbController) Get(dest interface{}, query string, args ...interface{})

func (*DbController) GetOrNoRow

func (ctrl *DbController) GetOrNoRow(dest interface{}, query string, args ...interface{}) bool

func (*DbController) InTx

func (ctrl *DbController) InTx(txCallback TxCallback)

Prepares transaction and feed it to callback function

func (*DbController) NamedExec

func (ctrl *DbController) NamedExec(query string, arg interface{}) sql.Result

func (*DbController) NamedQuery

func (ctrl *DbController) NamedQuery(query string, arg interface{}) *sqlx.Rows

func (*DbController) PrepareNamed

func (ctrl *DbController) PrepareNamed(query string) *sqlx.NamedStmt

func (*DbController) PrepareNamedExt

func (ctrl *DbController) PrepareNamedExt(query string) *NamedStmtExt

func (*DbController) Preparex

func (ctrl *DbController) Preparex(query string) *sqlx.Stmt

func (*DbController) PreparexExt

func (ctrl *DbController) PreparexExt(query string) *StmtExt

func (*DbController) QueryRowxAndMapScan

func (ctrl *DbController) QueryRowxAndMapScan(dest map[string]interface{}, query string, args ...interface{})

func (*DbController) QueryRowxAndScan

func (ctrl *DbController) QueryRowxAndScan(query string, args []interface{}, dest ...interface{})

func (*DbController) QueryRowxAndSliceScan

func (ctrl *DbController) QueryRowxAndSliceScan(query string, args ...interface{}) []interface{}

func (*DbController) QueryRowxAndStructScan

func (ctrl *DbController) QueryRowxAndStructScan(dest interface{}, query string, args ...interface{})

func (*DbController) QueryRowxExt

func (ctrl *DbController) QueryRowxExt(query string, args ...interface{}) *RowExt

func (*DbController) Queryx

func (ctrl *DbController) Queryx(query string, args ...interface{}) *sqlx.Rows

func (*DbController) QueryxExt

func (ctrl *DbController) QueryxExt(query string, args ...interface{}) *RowsExt

func (*DbController) Select

func (ctrl *DbController) Select(dest interface{}, query string, args ...interface{})

func (*DbController) SelectWithFoundRows

func (ctrl *DbController) SelectWithFoundRows(txCallback TxCallback, paging *commonModel.Paging)

func (*DbController) SqlxDb

func (ctrl *DbController) SqlxDb() *sqlx.DB

type NamedStmtExt

type NamedStmtExt sqlx.NamedStmt

Extensions for *sqlx.NamedStmt

func ToNamedStmtExt

func ToNamedStmtExt(stmt *sqlx.NamedStmt) *NamedStmtExt

func (*NamedStmtExt) Get

func (s *NamedStmtExt) Get(dest interface{}, arg interface{})

func (*NamedStmtExt) GetOrNoRow

func (s *NamedStmtExt) GetOrNoRow(dest interface{}, args interface{}) bool

func (*NamedStmtExt) QueryRowxAndMapScan

func (s *NamedStmtExt) QueryRowxAndMapScan(dest map[string]interface{}, args interface{})

func (*NamedStmtExt) QueryRowxAndScan

func (s *NamedStmtExt) QueryRowxAndScan(args []interface{}, dest ...interface{})

func (*NamedStmtExt) QueryRowxAndSliceScan

func (s *NamedStmtExt) QueryRowxAndSliceScan(args interface{}) []interface{}

func (*NamedStmtExt) QueryRowxAndStructScan

func (s *NamedStmtExt) QueryRowxAndStructScan(dest interface{}, args interface{})

func (*NamedStmtExt) QueryRowxExt

func (s *NamedStmtExt) QueryRowxExt(args interface{}) *RowExt

func (*NamedStmtExt) Queryx

func (s *NamedStmtExt) Queryx(args interface{}) *sqlx.Rows

func (*NamedStmtExt) QueryxExt

func (s *NamedStmtExt) QueryxExt(args interface{}) *RowsExt

func (*NamedStmtExt) Select

func (s *NamedStmtExt) Select(dest interface{}, arg interface{})

func (*NamedStmtExt) SqlxNamedStmt

func (s *NamedStmtExt) SqlxNamedStmt() *sqlx.NamedStmt

type RowExt

type RowExt sqlx.Row

func ToRowExt

func ToRowExt(row *sqlx.Row) *RowExt

func (*RowExt) MapScanOrNoRow

func (r *RowExt) MapScanOrNoRow(dest map[string]interface{}) bool

func (*RowExt) ScanOrNoRow

func (r *RowExt) ScanOrNoRow(dest ...interface{}) bool

func (*RowExt) SliceScanOrNoRow

func (r *RowExt) SliceScanOrNoRow() ([]interface{}, bool)

func (*RowExt) SqlxRow

func (r *RowExt) SqlxRow() *sqlx.Row

func (*RowExt) StructScanOrNoRow

func (r *RowExt) StructScanOrNoRow(dest interface{}) bool

type RowsExt

type RowsExt sqlx.Rows

func ToRowsExt

func ToRowsExt(row *sqlx.Rows) *RowsExt

func (*RowsExt) MapScan

func (r *RowsExt) MapScan(dest map[string]interface{})

func (*RowsExt) SliceScan

func (r *RowsExt) SliceScan() []interface{}

func (*RowsExt) SqlxRows

func (r *RowsExt) SqlxRows() *sqlx.Rows

func (*RowsExt) StructScan

func (r *RowsExt) StructScan(dest interface{})

type StmtExt

type StmtExt sqlx.Stmt

Extensions for *sqlx.Stmt

func ToStmtExt

func ToStmtExt(stmt *sqlx.Stmt) *StmtExt

func (*StmtExt) Get

func (s *StmtExt) Get(dest interface{}, args ...interface{})

func (*StmtExt) GetOrNoRow

func (s *StmtExt) GetOrNoRow(dest interface{}, args ...interface{}) bool

func (*StmtExt) QueryRowxAndMapScan

func (s *StmtExt) QueryRowxAndMapScan(dest map[string]interface{}, args ...interface{})

func (*StmtExt) QueryRowxAndScan

func (s *StmtExt) QueryRowxAndScan(args []interface{}, dest ...interface{})

func (*StmtExt) QueryRowxAndSliceScan

func (s *StmtExt) QueryRowxAndSliceScan(args ...interface{}) []interface{}

func (*StmtExt) QueryRowxAndStructScan

func (s *StmtExt) QueryRowxAndStructScan(dest interface{}, args ...interface{})

func (*StmtExt) QueryRowxExt

func (s *StmtExt) QueryRowxExt(args ...interface{}) *RowExt

func (*StmtExt) Queryx

func (s *StmtExt) Queryx(args ...interface{}) *sqlx.Rows

func (*StmtExt) QueryxExt

func (s *StmtExt) QueryxExt(args ...interface{}) *RowsExt

func (*StmtExt) Select

func (s *StmtExt) Select(dest interface{}, args ...interface{})

func (*StmtExt) SqlxStmt

func (s *StmtExt) SqlxStmt() *sqlx.Stmt

type TxCallback

type TxCallback interface {
	InTx(tx *sqlx.Tx) db.TxFinale
}

The interface of transaction callback for sqlx package

type TxCallbackFunc

type TxCallbackFunc func(*sqlx.Tx) db.TxFinale

The function object delegates the TxCallback interface

func (TxCallbackFunc) InTx

func (callbackFunc TxCallbackFunc) InTx(tx *sqlx.Tx) db.TxFinale

type TxExt

type TxExt sqlx.Tx

Extentsion for *sqlx.Tx

func ToTxExt

func ToTxExt(tx *sqlx.Tx) *TxExt

func (*TxExt) BindNamed

func (txExt *TxExt) BindNamed(query string, arg interface{}) (string, []interface{})

func (*TxExt) Get

func (txExt *TxExt) Get(dest interface{}, query string, args ...interface{})

func (*TxExt) GetOrNoRow

func (txExt *TxExt) GetOrNoRow(dest interface{}, query string, args ...interface{}) bool

func (*TxExt) NamedExec

func (txExt *TxExt) NamedExec(query string, arg interface{}) sql.Result

func (*TxExt) NamedQuery

func (txExt *TxExt) NamedQuery(query string, arg interface{}) *sqlx.Rows

func (*TxExt) PrepareNamed

func (txExt *TxExt) PrepareNamed(query string) *sqlx.NamedStmt

func (*TxExt) PrepareNamedExt

func (txExt *TxExt) PrepareNamedExt(query string) *NamedStmtExt

func (*TxExt) Preparex

func (txExt *TxExt) Preparex(query string) *sqlx.Stmt

func (*TxExt) PreparexExt

func (txExt *TxExt) PreparexExt(query string) *StmtExt

func (*TxExt) QueryRowAndScan

func (txExt *TxExt) QueryRowAndScan(query string, args []interface{}, dest []interface{})

func (*TxExt) QueryRowxAndMapScan

func (txExt *TxExt) QueryRowxAndMapScan(dest map[string]interface{}, query string, args ...interface{})

func (*TxExt) QueryRowxAndScan

func (txExt *TxExt) QueryRowxAndScan(query string, args []interface{}, dest ...interface{})

func (*TxExt) QueryRowxAndSliceScan

func (txExt *TxExt) QueryRowxAndSliceScan(query string, args ...interface{}) []interface{}

func (*TxExt) QueryRowxAndStructScan

func (txExt *TxExt) QueryRowxAndStructScan(dest interface{}, query string, args ...interface{})

func (*TxExt) QueryRowxExt

func (txExt *TxExt) QueryRowxExt(query string, args ...interface{}) *RowExt

func (*TxExt) Queryx

func (txExt *TxExt) Queryx(query string, args ...interface{}) *sqlx.Rows

func (*TxExt) QueryxExt

func (txExt *TxExt) QueryxExt(query string, args ...interface{}) *RowsExt

func (*TxExt) Select

func (txExt *TxExt) Select(dest interface{}, query string, args ...interface{})

func (*TxExt) SqlxTx

func (txExt *TxExt) SqlxTx() *sqlx.Tx

Query row and scan the result with panic

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL