sqliteutil

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListUserIndexesTx added in v0.10.0

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

func ListUserTablesTx

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

func Open

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

func TableColumnNamesTx added in v0.10.0

func TableColumnNamesTx(tx *sql.Tx, tableName string) ([]string, 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 DatabaseTooOldError added in v0.10.0

type DatabaseTooOldError struct {
	Kind           string
	Version        int
	MinimumVersion int
}

func (*DatabaseTooOldError) Error added in v0.10.0

func (e *DatabaseTooOldError) Error() string

type InvalidMigrationChainError

type InvalidMigrationChainError struct {
	Kind   string
	Reason string
}

func (*InvalidMigrationChainError) Error

type LegacyKindMigration added in v0.10.0

type LegacyKindMigration struct {
	FromKind    string
	FromVersion int
	ToKind      string
	ToVersion   int
	Apply       func(tx *sql.Tx) error
}

LegacyKindMigration converts one explicitly versioned older schema kind into the current schema before normal version migrations run.

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
	MinimumVersion       int
	Pragmas              []string
	Initialize           func(tx *sql.Tx) error
	Migrations           []Migration
	LegacyKindMigrations []LegacyKindMigration
	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