sqliteutil

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnExistsTx

func ColumnExistsTx(tx *sql.Tx, tableName string, columnName string) (bool, error)

func EnsureSchema

func EnsureSchema(db *sql.DB, spec Spec) error

func IndexExistsTx

func IndexExistsTx(tx *sql.Tx, indexName string) (bool, error)

func ListUserTablesTx

func ListUserTablesTx(tx *sql.Tx) ([]string, error)

func Open

func Open(path string, spec Spec) (*sql.DB, error)

func TableExistsTx

func TableExistsTx(tx *sql.Tx, tableName string) (bool, error)

Types

type DatabaseTooNewError

type DatabaseTooNewError struct {
	Kind           string
	Version        int
	CurrentVersion int
}

func (*DatabaseTooNewError) Error

func (e *DatabaseTooNewError) Error() string

type InvalidMigrationChainError

type InvalidMigrationChainError struct {
	Kind   string
	Reason string
}

func (*InvalidMigrationChainError) Error

type Migration

type Migration struct {
	FromVersion int
	ToVersion   int
	Apply       func(tx *sql.Tx) error
}

type SchemaVerifyError

type SchemaVerifyError struct {
	Kind string
	Err  error
}

func (*SchemaVerifyError) Error

func (e *SchemaVerifyError) Error() string

func (*SchemaVerifyError) Unwrap

func (e *SchemaVerifyError) Unwrap() error

type Spec

type Spec struct {
	Kind           string
	CurrentVersion int
	LegacyMarkers  []string
	Pragmas        []string
	Migrations     []Migration
	Verify         func(tx *sql.Tx) error
}

type WrongDatabaseKindError

type WrongDatabaseKindError struct {
	ExpectedKind string
	ActualKind   string
	Existing     []string
}

func (*WrongDatabaseKindError) Error

func (e *WrongDatabaseKindError) Error() string

Jump to

Keyboard shortcuts

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