database

package
v0.0.0-...-124c13c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDatabase

func ClearDatabase(db *sql.DB)

ClearDatabase drops user data tables and then creates default user

func ConnectionString

func ConnectionString(config *goconf.Config) string

func OpenDatabase

func OpenDatabase(config *goconf.Config) *sql.DB

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 NewAutoTx

func NewAutoTx(db *sql.DB) *AutoTx

func (*AutoTx) Close

func (tx *AutoTx) Close()

func (*AutoTx) Error

func (tx *AutoTx) Error() error

func (*AutoTx) Exec

func (tx *AutoTx) Exec(query string, args ...any)

func (*AutoTx) ExecStmt

func (tx *AutoTx) ExecStmt(stmt *sqlf.Stmt) *AutoTx

func (*AutoTx) Finish

func (tx *AutoTx) Finish()

func (*AutoTx) HasQueryError

func (tx *AutoTx) HasQueryError() bool

func (*AutoTx) LastQuery

func (tx *AutoTx) LastQuery() string

func (*AutoTx) Query

func (tx *AutoTx) Query(query string, args ...any) *AutoTx

func (*AutoTx) QueryBool

func (tx *AutoTx) QueryBool(query string, args ...any) bool

func (*AutoTx) QueryBools

func (tx *AutoTx) QueryBools(query string, args ...any) []bool

func (*AutoTx) QueryFloat64

func (tx *AutoTx) QueryFloat64(query string, args ...any) float64

func (*AutoTx) QueryInt64

func (tx *AutoTx) QueryInt64(query string, args ...any) int64

func (*AutoTx) QueryInt64s

func (tx *AutoTx) QueryInt64s(query string, args ...any) []int64

func (*AutoTx) QueryStmt

func (tx *AutoTx) QueryStmt(stmt *sqlf.Stmt) *AutoTx

func (*AutoTx) QueryString

func (tx *AutoTx) QueryString(query string, args ...any) string

func (*AutoTx) QueryStrings

func (tx *AutoTx) QueryStrings(query string, args ...any) []string

func (*AutoTx) RowsAffected

func (tx *AutoTx) RowsAffected() int64

func (*AutoTx) Scan

func (tx *AutoTx) Scan(dest ...any) bool

func (*AutoTx) ScanBool

func (tx *AutoTx) ScanBool() bool

func (*AutoTx) ScanBools

func (tx *AutoTx) ScanBools() []bool

func (*AutoTx) ScanFloat64

func (tx *AutoTx) ScanFloat64() float64

func (*AutoTx) ScanInt64

func (tx *AutoTx) ScanInt64() int64

func (*AutoTx) ScanInt64s

func (tx *AutoTx) ScanInt64s() []int64

func (*AutoTx) ScanString

func (tx *AutoTx) ScanString() string

func (*AutoTx) ScanStrings

func (tx *AutoTx) ScanStrings() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL