Documentation ¶
Index ¶
- Variables
- func StoreTx(ctx context.Context, tx *sql.Tx) context.Context
- type App
- func (a App) Bulk(ctx context.Context, feeder func(*sql.Stmt) error, schema, table string, ...) (err error)
- func (a App) Close() error
- func (a App) Create(ctx context.Context, query string, args ...interface{}) (uint64, error)
- func (a App) DoAtomic(ctx context.Context, action func(context.Context) error) (err error)
- func (a App) Enabled() bool
- func (a App) Exec(ctx context.Context, query string, args ...interface{}) error
- func (a App) Get(ctx context.Context, scanner func(*sql.Row) error, query string, ...) error
- func (a App) List(ctx context.Context, scanner func(*sql.Rows) error, query string, ...) (err error)
- func (a App) Ping() error
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoHost occurs when host is not provided in configuration ErrNoHost = errors.New("no host for database connection") // ErrNoTransaction occurs when no transaction is provided but needed ErrNoTransaction = errors.New("no transaction in context, please wrap with DoAtomic()") // ErrBulkEnded occurs when bulk creation is over ErrBulkEnded = errors.New("no more data to copy") // SQLTimeout when running queries SQLTimeout = time.Second * 5 )
Functions ¶
Types ¶
type App ¶ added in v4.14.0
type App struct {
// contains filtered or unexported fields
}
App of package
func (App) Bulk ¶ added in v4.14.0
func (a App) Bulk(ctx context.Context, feeder func(*sql.Stmt) error, schema, table string, columns ...string) (err error)
Bulk load data into schema and table by batch
func (App) Get ¶ added in v4.14.0
func (a App) Get(ctx context.Context, scanner func(*sql.Row) error, query string, args ...interface{}) error
Get execute single row query
Click to show internal directories.
Click to hide internal directories.