Documentation
¶
Index ¶
- func New(cfg driver.ConnectionConfig) (driver.Connector, driver.Backuper, driver.Restorer)
- type Engine
- func (e *Engine) Backup(ctx context.Context, opts driver.BackupOptions) (driver.BackupResult, error)
- func (e *Engine) Close() error
- func (e *Engine) Connect(ctx context.Context, cfg driver.ConnectionConfig) error
- func (e *Engine) IncrementalBasis() driver.IncrementalBasisKind
- func (e *Engine) Ping(ctx context.Context) error
- func (e *Engine) Restore(ctx context.Context, opts driver.RestoreOptions) error
- func (e *Engine) SupportsDifferential() bool
- func (e *Engine) SupportsIncremental() bool
- func (e *Engine) SupportsSelective() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine's cfg.Database is the .db file path — SQLite has no host/port/ user/password, so it reuses the field every other engine already uses for "what to back up" instead of introducing a second convention.
func (*Engine) Backup ¶
func (e *Engine) Backup(ctx context.Context, opts driver.BackupOptions) (driver.BackupResult, error)
Backup uses SQLite's own "VACUUM INTO" (SQLite >= 3.27), which produces a transactionally consistent full copy safe under concurrent writers — the online-backup-API equivalent, without needing a CGo binding of sqlite3_backup_init.
func (*Engine) IncrementalBasis ¶
func (e *Engine) IncrementalBasis() driver.IncrementalBasisKind
func (*Engine) Restore ¶
Restore is a plain file copy to opts.Database, written atomically via a temp file + rename so a reader never observes a half-written .db file.
func (*Engine) SupportsDifferential ¶
func (*Engine) SupportsIncremental ¶
func (*Engine) SupportsSelective ¶
SupportsSelective is false: a single-file database has no per-table restore via this interface — ATTACH + INSERT SELECT is a possible future feature, not built here.