This commit is contained in:
Ben Johnson
2021-01-18 15:46:52 -07:00
parent f31c22af62
commit 7fb98df240
15 changed files with 60 additions and 166 deletions

View File

@@ -13,9 +13,10 @@ import (
"github.com/benbjohnson/litestream"
)
type RestoreCommand struct {
}
// RestoreCommand represents a command to restore a database from a backup.
type RestoreCommand struct{}
// Run executes the command.
func (c *RestoreCommand) Run(ctx context.Context, args []string) (err error) {
var configPath string
opt := litestream.NewRestoreOptions()
@@ -82,6 +83,7 @@ func (c *RestoreCommand) Run(ctx context.Context, args []string) (err error) {
return db.Restore(ctx, opt)
}
// Usage prints the help screen to STDOUT.
func (c *RestoreCommand) Usage() {
fmt.Printf(`
The restore command recovers a database from a previous snapshot and WAL.