Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotInTransaction is returned when using Commit // outside of a transaction. ErrNotInTransaction = errors.New("not in transaction") // ErrIncompatibleOption is returned when using an option incompatible // with the selected driver. ErrIncompatibleOption = errors.New("incompatible option") )
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface { sqlx.Execer sqlx.ExecerContext sqlx.Queryer sqlx.QueryerContext sqlx.Preparer sqlx.PreparerContext BindNamed(query string, arg interface{}) (string, []interface{}, error) DriverName() string Get(dest interface{}, query string, args ...interface{}) error MustExec(query string, args ...interface{}) sql.Result NamedExec(query string, arg interface{}) (sql.Result, error) NamedQuery(query string, arg interface{}) (*sqlx.Rows, error) PrepareNamed(query string) (*sqlx.NamedStmt, error) Preparex(query string) (*sqlx.Stmt, error) Rebind(query string) string Select(dest interface{}, query string, args ...interface{}) error }
A Driver can query the database. It can either be a *sqlx.DB or a *sqlx.Tx and therefore is limited to the methods they have in common.
type Node ¶
type Node interface { Driver // Close the underlying sqlx connection. Close() error // Begin a new transaction. Beginx() (Node, error) // Rollback the associated transaction. Rollback() error // Commit the assiociated transaction. Commit() error // Tx returns the underlying transaction. Tx() *sqlx.Tx }
A Node is a database driver that can manage nested transactions.
Click to show internal directories.
Click to hide internal directories.