sqlite

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRows = sqlite.ErrNoRows
)

Functions

func GetCurrentMigrationVersion

func GetCurrentMigrationVersion(conn Conn) (int, error)

func MigrateAll

func MigrateAll(conn Conn, migrations []Migration) error

func Scalar

func Scalar[T any](conn Conn, sql string, args ...any) (T, error)

Types

type Conn

type Conn struct {
	sqlite.Conn
}

func New

func New(filePath string, create bool) (Conn, error)

func (Conn) IsNotFound

func (c Conn) IsNotFound(err error) bool

func (Conn) Placeholder

func (_ Conn) Placeholder(i int) string

Exists for our test factory which are designed to work with different databases

func (Conn) RowToMap

func (c Conn) RowToMap(sql string, args ...any) (typed.Typed, error)

func (Conn) RowsToMap

func (c Conn) RowsToMap(sql string, args ...any) ([]typed.Typed, error)

func (Conn) TableExists

func (c Conn) TableExists(tableName string) (bool, error)

type Migrate

type Migrate func(conn Conn) error

type Migration

type Migration struct {
	Version uint16
	Migrate Migrate
}

type Scanner

type Scanner sqlite.Scanner

Jump to

Keyboard shortcuts

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