Documentation
¶
Index ¶
- Variables
- func BindNamedArgs(exe Executor, q string, namedArgs interface{}) (string, []interface{})
- func EnableLogging()
- func OpenReadableDB(drivername, uri string)
- func OpenWriteableDB(driverName, uri string)
- func SetLogger(l *log.Logger)
- func Tx(ctx context.Context) (nctx context.Context, committer func())
- func UseWriteableDB(ctx context.Context) context.Context
- type Data
- type Executor
- type JsonArray
- type JsonObject
- type Model
- type Modeler
- type Operator
- func (op *Operator) CreateTable()
- func (op *Operator) Delete(ctx context.Context, cond string, namedargs interface{}) sql.Result
- func (op *Operator) FetchMany(ctx context.Context, keysGroup string, condition string, arg interface{}, ...) error
- func (op *Operator) FetchOne(ctx context.Context, keysGroup string, condition string, namedargs interface{}, ...) error
- func (op *Operator) GroupColumns(name string) []string
- func (op *Operator) GroupColumnsAppend(name, val string)
- func (op *Operator) GroupColumnsRemove(name, val string)
- func (op *Operator) Insert(ctx context.Context, data Data) int64
- func (op *Operator) InsertWithReturning(ctx context.Context, data Data, returning string, dist ...interface{})
- func (op *Operator) IsImmutableField(f string) bool
- func (op *Operator) RowColumns(ctx context.Context, columns []string, cond string, namedargs interface{}, ...) error
- func (op *Operator) RowsColumn(ctx context.Context, column string, cond string, namedargs interface{}, ...) error
- func (op *Operator) TableName() string
- func (op *Operator) Update(ctx context.Context, data Data, condition string, namedargs interface{}) sql.Result
- type Raw
- type RollbackError
- type W
- func (w W) Exec(ctx context.Context, q string, namedargs interface{}) sql.Result
- func (w W) Get(ctx context.Context, q string, namedArgs interface{}, dist interface{}) error
- func (w W) ScanRow(ctx context.Context, q string, namedargs interface{}, dist ...interface{}) error
- func (w W) ScanRows(ctx context.Context, q string, namedargs interface{}, ...) error
- func (w W) Select(ctx context.Context, q string, namedArgs interface{}, sliceDist interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDeleteWithoutCondition = errors.New("sha.sqlx: delete without condition")
View Source
var ErrEmptyConditionOrEmptyData = errors.New("sha.sqlx: empty condition or empty data")
View Source
var ErrImmutableField = errors.New("sha.sqlx: immutable field")
View Source
var ErrJsonValue = errors.New("sha.sqlx: json value error")
View Source
var ErrSubTx = errors.New("sha.sqlx: sub tx is invalid")
Functions ¶
func BindNamedArgs ¶ added in v0.0.5
func EnableLogging ¶
func EnableLogging()
func OpenReadableDB ¶
func OpenReadableDB(drivername, uri string)
func OpenWriteableDB ¶
func OpenWriteableDB(driverName, uri string)
Types ¶
type Executor ¶
type Executor interface {
x.ExecerContext
x.QueryerContext
GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
PreparexContext(ctx context.Context, query string) (*x.Stmt, error)
DriverName() string
BindNamed(query string, arg interface{}) (string, []interface{}, error)
}
type JsonObject ¶
type JsonObject map[string]interface{}
func (*JsonObject) Scan ¶
func (f *JsonObject) Scan(src interface{}) error
type Model ¶
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func NewOperator ¶
func (*Operator) CreateTable ¶
func (op *Operator) CreateTable()
func (*Operator) GroupColumns ¶
func (*Operator) GroupColumnsAppend ¶ added in v0.0.5
func (*Operator) GroupColumnsRemove ¶ added in v0.0.5
func (*Operator) InsertWithReturning ¶
func (*Operator) IsImmutableField ¶ added in v0.0.5
func (*Operator) RowColumns ¶
func (*Operator) RowsColumn ¶
type RollbackError ¶
type RollbackError struct {
RecoverVal interface{}
Err error
}
func (*RollbackError) Error ¶
func (re *RollbackError) Error() string
Click to show internal directories.
Click to hide internal directories.