Documentation
¶
Overview ¶
Package sqlitemigrate provides a SQLite-specific migration executor for the Grove migration system.
Index ¶
- type Executor
- func (e *Executor) AcquireLock(ctx context.Context, lockedBy string) error
- func (e *Executor) EnsureLockTable(ctx context.Context) error
- func (e *Executor) EnsureMigrationTable(ctx context.Context) error
- func (e *Executor) Exec(ctx context.Context, query string, args ...any) (driver.Result, error)
- func (e *Executor) ListApplied(ctx context.Context) ([]*migrate.AppliedMigration, error)
- func (e *Executor) Query(ctx context.Context, query string, args ...any) (driver.Rows, error)
- func (e *Executor) RecordApplied(ctx context.Context, m *migrate.Migration) error
- func (e *Executor) ReleaseLock(ctx context.Context) error
- func (e *Executor) RemoveApplied(ctx context.Context, m *migrate.Migration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor implements migrate.Executor for SQLite.
func (*Executor) AcquireLock ¶
AcquireLock attempts to acquire the migration lock using a table-based approach. SQLite is single-writer by nature, so this provides a simple cooperative lock via INSERT OR IGNORE + UPDATE.
func (*Executor) EnsureLockTable ¶
EnsureLockTable creates the grove_migration_locks table if it doesn't exist.
func (*Executor) EnsureMigrationTable ¶
EnsureMigrationTable creates the grove_migrations table if it doesn't exist.
func (*Executor) ListApplied ¶
ListApplied returns all migrations that have been applied, ordered by id ascending.
func (*Executor) RecordApplied ¶
RecordApplied records that a migration was successfully applied.
func (*Executor) ReleaseLock ¶
ReleaseLock releases the migration lock.