Documentation
¶
Index ¶
- func CreateDbFile(fileName string)
- func LoadConnection(databaseName string) *sqlx.DB
- func RemoveDbFile(filePath string)
- func SetupKV()
- type Connection
- type DbCon
- type TracedDB
- func (db *TracedDB) BeginTxx(ctx context.Context, opts interface{}) (tx *sqlx.Tx, err error)
- func (db *TracedDB) ExecContext(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error)
- func (db *TracedDB) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error)
- func (db *TracedDB) NamedExecContext(ctx context.Context, query string, arg interface{}) (result sql.Result, err error)
- func (db *TracedDB) QueryContext(ctx context.Context, query string, args ...interface{}) (rows *sqlx.Rows, err error)
- func (db *TracedDB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row
- func (db *TracedDB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDbFile ¶
func CreateDbFile(fileName string)
func LoadConnection ¶
func RemoveDbFile ¶
func RemoveDbFile(filePath string)
Types ¶
type Connection ¶
type Connection interface {
Exec(query string, args ...any) (sql.Result, error)
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
Prepare(query string) (*sql.Stmt, error)
PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
Query(query string, args ...any) (*sql.Rows, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryRow(query string, args ...any) *sql.Row
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}
type DbCon ¶
func GetKvDbConn ¶
func GetKvDbConn() *DbCon
func (*DbCon) BeginImmediateTransaction ¶
func (*DbCon) RunMigrations ¶
func (db *DbCon) RunMigrations()
type TracedDB ¶
TODO: use trace for db statements later on
func WrapDBWithTracing ¶
func (*TracedDB) ExecContext ¶
func (*TracedDB) GetContext ¶
func (*TracedDB) NamedExecContext ¶
func (*TracedDB) QueryContext ¶
func (*TracedDB) QueryRowContext ¶
Click to show internal directories.
Click to hide internal directories.