database

package
v0.0.0-...-73d934c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindTime

func BindTime(stmt *sqlite.Stmt, param string, t time.Time)

BindTime sets the time as a SQL query bind parameter. Zero time sets NULL.

func GetTime

func GetTime(stmt *sqlite.Stmt, param string) (time.Time, error)

GetTime extracts the time from a query result column. NULL becomes zero time.

func GetUint8

func GetUint8(stmt *sqlite.Stmt, param string) (uint8, error)

GetUint8 extracts a uint8 from a query result column, ensuring it does not overflow.

func NoMoreRows

func NoMoreRows(stmt *sqlite.Stmt) error

NoMoreRows returns an error if there are still more rows in the query results.

func Row

func Row(stmt *sqlite.Stmt) error

Row fetches the next row in the query results. It returns an error if there is no next row.

Types

type DB

type DB struct {
	*sqlitex.Pool
}

func Open

func Open(dbPath string) (*DB, error)

func Scratch

func Scratch() *DB

func (DB) Get

func (db DB) Get(ctx context.Context) *sqlite.Conn

Jump to

Keyboard shortcuts

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