Documentation
¶
Index ¶
- func ClearDatabase(db *sql.DB)
- func ConnectionString(config *goconf.Config) string
- func OpenDatabase(config *goconf.Config) *sql.DB
- func Transact(db *sql.DB, txFunc func(*AutoTx) middleware.Responder) middleware.Responder
- type AutoTx
- func (tx *AutoTx) Close()
- func (tx *AutoTx) Error() error
- func (tx *AutoTx) Exec(query string, args ...any)
- func (tx *AutoTx) ExecStmt(stmt *sqlf.Stmt) *AutoTx
- func (tx *AutoTx) Finish()
- func (tx *AutoTx) HasQueryError() bool
- func (tx *AutoTx) LastQuery() string
- func (tx *AutoTx) Query(query string, args ...any) *AutoTx
- func (tx *AutoTx) QueryBool(query string, args ...any) bool
- func (tx *AutoTx) QueryBools(query string, args ...any) []bool
- func (tx *AutoTx) QueryFloat64(query string, args ...any) float64
- func (tx *AutoTx) QueryInt64(query string, args ...any) int64
- func (tx *AutoTx) QueryInt64s(query string, args ...any) []int64
- func (tx *AutoTx) QueryStmt(stmt *sqlf.Stmt) *AutoTx
- func (tx *AutoTx) QueryString(query string, args ...any) string
- func (tx *AutoTx) QueryStrings(query string, args ...any) []string
- func (tx *AutoTx) RowsAffected() int64
- func (tx *AutoTx) Scan(dest ...any) bool
- func (tx *AutoTx) ScanBool() bool
- func (tx *AutoTx) ScanBools() []bool
- func (tx *AutoTx) ScanFloat64() float64
- func (tx *AutoTx) ScanInt64() int64
- func (tx *AutoTx) ScanInt64s() []int64
- func (tx *AutoTx) ScanString() string
- func (tx *AutoTx) ScanStrings() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearDatabase ¶
ClearDatabase drops user data tables and then creates default user
func ConnectionString ¶
func OpenDatabase ¶
OpenDatabase returns db opened from config.
func Transact ¶
func Transact(db *sql.DB, txFunc func(*AutoTx) middleware.Responder) middleware.Responder
Transact wraps func in an SQL transaction. Responder will be just passed through.
Types ¶
type AutoTx ¶
type AutoTx struct {
// contains filtered or unexported fields
}
func (*AutoTx) HasQueryError ¶
func (*AutoTx) RowsAffected ¶
func (*AutoTx) ScanFloat64 ¶
func (*AutoTx) ScanInt64s ¶
func (*AutoTx) ScanString ¶
func (*AutoTx) ScanStrings ¶
Click to show internal directories.
Click to hide internal directories.