Documentation
¶
Index ¶
- func Backup(ctx context.Context, source, destination string, spec Spec) (err error)
- func ListUserIndexesTx(tx *sql.Tx) ([]string, error)
- func ListUserTablesTx(tx *sql.Tx) ([]string, error)
- func Open(path string, spec Spec) (*sql.DB, error)
- func TableColumnNamesTx(tx *sql.Tx, tableName string) ([]string, error)
- func TableExistsTx(tx *sql.Tx, tableName string) (bool, error)
- type DatabaseTooNewError
- type DatabaseTooOldError
- type Inspection
- type InvalidMigrationChainError
- type LegacyKindMigration
- type Migration
- type SchemaVerifyError
- type Spec
- type WrongDatabaseKindError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backup ¶ added in v0.13.0
Backup copies committed SQLite state, including WAL, into an exclusive new destination. The storage owner must close its database and exclude writers.
func TableColumnNamesTx ¶ added in v0.10.0
Types ¶
type DatabaseTooNewError ¶
func (*DatabaseTooNewError) Error ¶
func (e *DatabaseTooNewError) Error() string
type DatabaseTooOldError ¶ added in v0.10.0
func (*DatabaseTooOldError) Error ¶ added in v0.10.0
func (e *DatabaseTooOldError) Error() string
type Inspection ¶ added in v0.13.0
Inspection describes committed product storage without a writable open.
func Inspect ¶ added in v0.13.0
func Inspect(path string, spec Spec) (result Inspection, err error)
Inspect reuses the WAL-aware preflight used by Open. It never initializes a missing file or executes migration steps. Owners validate historical shapes through ValidateExisting; current stores also pass their final verifier.
type InvalidMigrationChainError ¶
func (*InvalidMigrationChainError) Error ¶
func (e *InvalidMigrationChainError) Error() string
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 SchemaVerifyError ¶
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
// ValidateExisting runs only for a non-empty existing file, before any writable connection.
ValidateExisting func(tx *sql.Tx) error
Initialize func(tx *sql.Tx) error
Migrations []Migration
LegacyKindMigrations []LegacyKindMigration
Verify func(tx *sql.Tx) error
}
type WrongDatabaseKindError ¶
func (*WrongDatabaseKindError) Error ¶
func (e *WrongDatabaseKindError) Error() string
Click to show internal directories.
Click to hide internal directories.