exec

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

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

func NewExecutor

func NewExecutor(db *sql.DB, logger logo.Logger, logSQL LogSQL) *Executor

func (*Executor) Exec

func (e *Executor) Exec(sql string, args ...interface{}) (sql.Result, error)

func (*Executor) ExecContext

func (e *Executor) ExecContext(ctx context.Context, sql string, args ...interface{}) (sql.Result, error)

func (*Executor) QueryContextRow

func (e *Executor) QueryContextRow(ctx context.Context, sql string, args ...interface{}) *sql.Row

func (*Executor) QueryContextRows

func (e *Executor) QueryContextRows(ctx context.Context, sql string, args ...interface{}) (*sql.Rows, error)

func (*Executor) QueryRow

func (e *Executor) QueryRow(sql string, args ...interface{}) *sql.Row

func (*Executor) QueryRows

func (e *Executor) QueryRows(sql string, args ...interface{}) (*sql.Rows, error)

type LogSQL added in v0.2.0

type LogSQL interface {
	LogSQL() bool
}

type SQLExecutor

type SQLExecutor interface {
	// SetLogSQL(logSQL bool)
	QueryRow(sql string, args ...interface{}) *sql.Row
	QueryRows(sql string, args ...interface{}) (*sql.Rows, error)
	QueryContextRow(ctx context.Context, sql string, args ...interface{}) *sql.Row
	QueryContextRows(ctx context.Context, sql string, args ...interface{}) (*sql.Rows, error)

	Exec(query string, args ...interface{}) (sql.Result, error)
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
}

type TXExecutor

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

func NewTXExecutor

func NewTXExecutor(ctx context.Context, db *sql.DB, logger logo.Logger, logSQL LogSQL) (*TXExecutor, error)

func (*TXExecutor) Commit

func (tx *TXExecutor) Commit() error

func (*TXExecutor) Exec

func (tx *TXExecutor) Exec(sql string, args ...interface{}) (sql.Result, error)

func (*TXExecutor) ExecContext

func (tx *TXExecutor) ExecContext(ctx context.Context, sql string, args ...interface{}) (sql.Result, error)

func (*TXExecutor) QueryContextRow

func (tx *TXExecutor) QueryContextRow(ctx context.Context, sql string, args ...interface{}) *sql.Row

func (*TXExecutor) QueryContextRows

func (tx *TXExecutor) QueryContextRows(ctx context.Context, sql string, args ...interface{}) (*sql.Rows, error)

func (*TXExecutor) QueryRow

func (tx *TXExecutor) QueryRow(sql string, args ...interface{}) *sql.Row

func (*TXExecutor) QueryRows

func (tx *TXExecutor) QueryRows(sql string, args ...interface{}) (*sql.Rows, error)

func (*TXExecutor) Rollback

func (tx *TXExecutor) Rollback() error

Jump to

Keyboard shortcuts

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