sqlite

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 7 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) JSON added in v0.0.7

func (_ Conn) JSON(value any) (any, error)

Exists for our test factory which are designed to work with different databases And, for SQLite, we can't just pass any object in to have it converted to JSON

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 {
	Migrate Migrate
	Version uint16
}

type Scanner

type Scanner sqlite.Scanner

Jump to

Keyboard shortcuts

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