Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTransactionStarted = errors.New("transaction has already been started") ErrDBType = errors.New("wrong type of DB interface") )
Functions ¶
func JsonbToBytes ¶
Types ¶
type DB ¶
type DB interface { // GetContext using this DB. // Any placeholder parameters are replaced with supplied args. // An error is returned if the result set is empty. GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error // SelectContext using this DB. // Any placeholder parameters are replaced with supplied args. SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error // Rebind transforms a query from QUESTION to the DB driver's bindvar type. Rebind(query string) string // BindNamed binds a query using the DB driver's bindvar type. BindNamed(query string, arg interface{}) (string, []interface{}, error) // NamedExecContext using this DB. // Any named placeholder parameters are replaced with fields from arg. NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) // ExecContext executes a query without returning any rows. // The args are for any placeholder parameters in the query. ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) // QueryxContext queries the database and returns an *sqlx.Rows. // Any placeholder parameters are replaced with supplied args. QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) }
DB interface is implemented by sqlx.DB and sqlx.Tx so it can be used either by db or transaction instance
Click to show internal directories.
Click to hide internal directories.