Documentation ¶
Index ¶
- func AddPrefix(fields []string, prefix string) []string
- func Assign(field string, value string) string
- func Equal(field string, value string) string
- func Extract(fields []string, prefix string) string
- func NewContext(ctx context.Context, q Queryable) context.Context
- func RunAlwaysRollbackTransaction(db *sqlx.DB, f func(tx *sqlx.Tx) error) error
- func RunInTransaction(db *sqlx.DB, obj IRunInTransaction, f func(tx *sqlx.Tx) error) error
- func RunInTransactionWithDB(db *sqlx.DB, f func(tx *sqlx.Tx) error) error
- type Entity
- type IRunInTransaction
- type Order
- type Queryable
- type QueryableContext
- func (qtx *QueryableContext) BindNamed(query string, arg interface{}) (string, []interface{}, error)
- func (qtx *QueryableContext) DB() *sqlx.DB
- func (qtx *QueryableContext) DriverName() string
- func (qtx *QueryableContext) Get(dest interface{}, query string, args ...interface{}) error
- func (qtx *QueryableContext) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (qtx *QueryableContext) MustExec(query string, args ...interface{}) sql.Result
- func (qtx *QueryableContext) MustExecContext(ctx context.Context, query string, args ...interface{}) sql.Result
- func (qtx *QueryableContext) NamedExec(query string, arg interface{}) (sql.Result, error)
- func (qtx *QueryableContext) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
- func (qtx *QueryableContext) NamedQuery(query string, arg interface{}) (*sqlx.Rows, error)
- func (qtx *QueryableContext) PrepareNamed(query string) (*sqlx.NamedStmt, error)
- func (qtx *QueryableContext) PrepareNamedContext(ctx context.Context, query string) (*sqlx.NamedStmt, error)
- func (qtx *QueryableContext) Preparex(query string) (*sqlx.Stmt, error)
- func (qtx *QueryableContext) PreparexContext(ctx context.Context, query string) (*sqlx.Stmt, error)
- func (qtx *QueryableContext) QueryRowx(query string, args ...interface{}) *sqlx.Row
- func (qtx *QueryableContext) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row
- func (qtx *QueryableContext) Queryx(query string, args ...interface{}) (*sqlx.Rows, error)
- func (qtx *QueryableContext) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error)
- func (qtx *QueryableContext) Rebind(query string) string
- func (qtx *QueryableContext) Select(dest interface{}, query string, args ...interface{}) error
- func (qtx *QueryableContext) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (qtx *QueryableContext) Tx() *sqlx.Tx
- type Scanner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunAlwaysRollbackTransaction ¶
RunAlwaysRollbackTransaction runs function with the transaction context without applying the context and rollback
func RunInTransaction ¶
RunInTransaction runs function with transaction context and auto apply the context into existing IRunTransaction object
Types ¶
type IRunInTransaction ¶
type IRunInTransaction interface {
UpdateQueryable(queryable QueryableContext)
}
IRunInTransaction interface for calling runInTransactionWith
type Queryable ¶
type Queryable interface { BindNamed(query string, arg interface{}) (string, []interface{}, error) DriverName() string Get(dest interface{}, query string, args ...interface{}) error GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error MustExec(query string, args ...interface{}) sql.Result MustExecContext(ctx context.Context, query string, args ...interface{}) sql.Result NamedExec(query string, arg interface{}) (sql.Result, error) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) NamedQuery(query string, arg interface{}) (*sqlx.Rows, error) PrepareNamed(query string) (*sqlx.NamedStmt, error) PrepareNamedContext(ctx context.Context, query string) (*sqlx.NamedStmt, error) Preparex(query string) (*sqlx.Stmt, error) PreparexContext(ctx context.Context, query string) (*sqlx.Stmt, error) QueryRowx(query string, args ...interface{}) *sqlx.Row QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row Queryx(query string, args ...interface{}) (*sqlx.Rows, error) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) Rebind(query string) string Select(dest interface{}, query string, args ...interface{}) error SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error }
Queryable ...
type QueryableContext ¶
type QueryableContext struct {
// contains filtered or unexported fields
}
QueryableContext ...
func NewQueryableContext ¶
func NewQueryableContext(db *sqlx.DB) QueryableContext
NewQueryableContext ...
func NewQueryableContextFromTx ¶
func NewQueryableContextFromTx(tx *sqlx.Tx) QueryableContext
NewQueryableContextFromTx ...
func (*QueryableContext) BindNamed ¶
func (qtx *QueryableContext) BindNamed(query string, arg interface{}) (string, []interface{}, error)
BindNamed ...
func (*QueryableContext) DriverName ¶
func (qtx *QueryableContext) DriverName() string
DriverName ...
func (*QueryableContext) Get ¶
func (qtx *QueryableContext) Get(dest interface{}, query string, args ...interface{}) error
Get ...
func (*QueryableContext) GetContext ¶
func (qtx *QueryableContext) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
GetContext ...
func (*QueryableContext) MustExec ¶
func (qtx *QueryableContext) MustExec(query string, args ...interface{}) sql.Result
MustExec ...
func (*QueryableContext) MustExecContext ¶
func (qtx *QueryableContext) MustExecContext(ctx context.Context, query string, args ...interface{}) sql.Result
MustExecContext ...
func (*QueryableContext) NamedExec ¶
func (qtx *QueryableContext) NamedExec(query string, arg interface{}) (sql.Result, error)
NamedExec ...
func (*QueryableContext) NamedExecContext ¶
func (qtx *QueryableContext) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error)
NamedExecContext ...
func (*QueryableContext) NamedQuery ¶
func (qtx *QueryableContext) NamedQuery(query string, arg interface{}) (*sqlx.Rows, error)
NamedQuery ...
func (*QueryableContext) PrepareNamed ¶
func (qtx *QueryableContext) PrepareNamed(query string) (*sqlx.NamedStmt, error)
PrepareNamed ...
func (*QueryableContext) PrepareNamedContext ¶
func (qtx *QueryableContext) PrepareNamedContext(ctx context.Context, query string) (*sqlx.NamedStmt, error)
PrepareNamedContext ...
func (*QueryableContext) Preparex ¶
func (qtx *QueryableContext) Preparex(query string) (*sqlx.Stmt, error)
Preparex ...
func (*QueryableContext) PreparexContext ¶
PreparexContext ...
func (*QueryableContext) QueryRowx ¶
func (qtx *QueryableContext) QueryRowx(query string, args ...interface{}) *sqlx.Row
QueryRowx ...
func (*QueryableContext) QueryRowxContext ¶
func (qtx *QueryableContext) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row
QueryRowxContext ...
func (*QueryableContext) Queryx ¶
func (qtx *QueryableContext) Queryx(query string, args ...interface{}) (*sqlx.Rows, error)
Queryx ...
func (*QueryableContext) QueryxContext ¶
func (qtx *QueryableContext) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error)
QueryxContext ...
func (*QueryableContext) Rebind ¶
func (qtx *QueryableContext) Rebind(query string) string
Rebind ...
func (*QueryableContext) Select ¶
func (qtx *QueryableContext) Select(dest interface{}, query string, args ...interface{}) error
Select ...
func (*QueryableContext) SelectContext ¶
func (qtx *QueryableContext) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
SelectContext ...