db

package
v0.0.0-...-544625c Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRows error = sql.ErrNoRows

Functions

func Connect

func Connect()

func MigrateDB

func MigrateDB()

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func GetConnection

func GetConnection() *DB

func (*DB) Exec

func (db *DB) Exec(sql string, args ...any) error

func (*DB) First

func (db *DB) First(sql string, args ...any) *sql.Row

func (*DB) Get

func (db *DB) Get(sql string, args ...any) (*sql.Rows, error)

func (*DB) IsTableExist

func (db *DB) IsTableExist(table string) bool

func (*DB) Transaction

func (db *DB) Transaction(callback func(tx *sql.Tx) error) error

type QueryArgs

type QueryArgs struct {
	Args []any
}

Jump to

Keyboard shortcuts

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