You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently the godoc for Replica.Restore and RestoreOptions.OutputPath intimate that if OutputPath == "", then Replica.db.path will be used:
package litestream // import "github.com/benbjohnson/litestream"func (r*Replica) Restore(ctx context.Context, optRestoreOptions) (errerror)
Replicarestoresthedatabasefromareplicabasedontheoptions given.
Thismethodwillrestoreintoopt.OutputPath, ifspecified, orintotheDB's
originaldatabase path. Itcanoptionallyrestorefromaspecificreplicaorgenerationoritwillautomaticallychoosethebestone. Finally, atimestampcanbespecifiedtorestorethedatabasetoaspecificpoint-in-time.
typeRestoreOptionsstruct {
// Target path to restore into. If blank, the original DB path is used.OutputPathstring// ... other fields elided ...
}
this is not what happens today. it looks like this logic was introduced in fb80bc1, which contains both the wording and its contradictory behaviour, as it exists today. if this wording was unintentional, I would suggest removing it from both godocs, otherwise this diff (or something similar) should resolve the issue: (provided here due to your contribution policy)
@colin-sitehost Thanks for the bug report. I've updated the contribution policy to allow for bug fixes. Feel free to submit a PR or I can update the code myself. The main branch is currently in flux so it's best to use the latest release version instead (v0.3.5).
Per the godoc on Replica.Restore and RestoreOptions.OutputPath,
Replica.db.path should be used when RestoreOptions.OutputPath is empty.
Fixesbenbjohnson#233
currently the godoc for
Replica.Restore
andRestoreOptions.OutputPath
intimate that ifOutputPath == ""
, thenReplica.db.path
will be used:this is not what happens today. it looks like this logic was introduced in fb80bc1, which contains both the wording and its contradictory behaviour, as it exists today. if this wording was unintentional, I would suggest removing it from both godocs, otherwise this diff (or something similar) should resolve the issue: (provided here due to your contribution policy)
The text was updated successfully, but these errors were encountered: