Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = sql.ErrNoRows
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { Close() error Ping(ctx context.Context) error In(query string, args ...interface{}) (string, []interface{}, error) Rebind(query string) string QueryIn(ctx context.Context, name string, query string, args ...interface{}) (*sqlx.Rows, error) QueryRow(ctx context.Context, name string, query string, args ...interface{}) (*sqlx.Row, error) Query(ctx context.Context, name string, query string, args ...interface{}) (*sqlx.Rows, error) NamedQuery(ctx context.Context, name string, query string, arg interface{}) (*sqlx.Rows, error) Prepare(ctx context.Context, name string, query string) (CommandStmt, error) NamedExec(ctx context.Context, name string, query string, args interface{}) (sql.Result, error) Exec(ctx context.Context, name string, query string, args ...interface{}) (sql.Result, error) BeginTx(ctx context.Context, name string, opts TxOptions) (CommandTx, error) Get(ctx context.Context, name string, query string, dest interface{}, args ...interface{}) error }
type CommandStmt ¶
type CommandStmt interface { Close() error Select(name string, dest interface{}, args ...interface{}) error Get(name string, dest interface{}, args ...interface{}) error QueryRow(name string, args ...interface{}) (*sqlx.Row, error) Query(name string, args ...interface{}) (*sqlx.Rows, error) Exec(name string, args ...interface{}) (sql.Result, error) }
type CommandTx ¶
type CommandTx interface { Commit() error Rollback() Rebind(query string) string Select(name string, query string, dest interface{}, args ...interface{}) error Get(name string, query string, dest interface{}, args ...interface{}) error QueryRow(name string, query string, args ...interface{}) (*sqlx.Row, error) Query(name string, query string, args ...interface{}) (*sqlx.Rows, error) Prepare(name string, query string) (CommandStmt, error) NamedExec(name string, query string, args interface{}) (sql.Result, error) Exec(name string, query string, args ...interface{}) (sql.Result, error) Stmt(name string, stmt *sqlx.Stmt) CommandStmt }
type Config ¶
type Config struct { UseInstrument bool LogQuery bool Driver string Name string Leader ConnConfig Follower ConnConfig }
type ConnConfig ¶
type TxOptions ¶
type TxOptions struct { Isolation sql.IsolationLevel ReadOnly bool }
Click to show internal directories.
Click to hide internal directories.