Documentation
¶
Index ¶
- Variables
- func CreateWithTimeout(db *sql.DB, tx *sql.Tx, sqlTimeout time.Duration, query string, ...) (newID uint64, err error)
- func EndTx(tx *sql.Tx, err error) error
- func ExecWithTimeout(db *sql.DB, tx *sql.Tx, sqlTimeout time.Duration, query string, ...) (err error)
- func GetTx(db *sql.DB, tx *sql.Tx) (*sql.Tx, error)
- func New(config Config) (*sql.DB, error)
- func Ping(db *sql.DB) bool
- func RowsClose(rows *sql.Rows, err error) 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") )
Functions ¶
func CreateWithTimeout ¶ added in v3.15.0
func CreateWithTimeout(db *sql.DB, tx *sql.Tx, sqlTimeout time.Duration, query string, args ...interface{}) (newID uint64, err error)
CreateWithTimeout execute query with a RETURNING id
func ExecWithTimeout ¶ added in v3.15.0
func ExecWithTimeout(db *sql.DB, tx *sql.Tx, sqlTimeout time.Duration, query string, args ...interface{}) (err error)
ExecWithTimeout execute query with specified timeout, disregarding result
Types ¶
Click to show internal directories.
Click to hide internal directories.