sql

package
v0.0.0-...-cba2ebf Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbPath string
View Source
var ErrNoRows = sql.ErrNoRows
View Source
var InitDDL string

Functions

func CloseDB

func CloseDB() error

func DecodeBase64

func DecodeBase64(data string) []byte

func DecodeTime

func DecodeTime(v int64) time.Time

func DeleteDB

func DeleteDB() error

func EncodeBase64

func EncodeBase64(data []byte) string

func EncodeTime

func EncodeTime(t time.Time) int64

func Exec

func Exec(key string, m Args) (sql.Result, error)

func LoadSQLFromFile

func LoadSQLFromFile(name string)

LoadSQLFromFile loads the sql queries from the provided file path. It panics in case the file cannot be loaded

func OpenDB

func OpenDB(dbPath string) error

func Query

func Query(key string, m Args) (*sql.Rows, error)

func QueryEx

func QueryEx[T any](key string, m Args, f func(dest ...any) T) ([]T, error)

func QueryRow

func QueryRow(key string, m Args, dest ...any) error

Types

type Args

type Args map[string]any

Jump to

Keyboard shortcuts

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