Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

bottomless-cli: add verify command #744

Merged
merged 2 commits into from
Oct 6, 2023
Merged

bottomless-cli: add verify command #744

merged 2 commits into from
Oct 6, 2023

Conversation

psarna
Copy link
Contributor

@psarna psarna commented Oct 6, 2023

The command works similarly to restore, except it restores to a temporary directory and runs a pragma integrity_check query.

On success it should return:

bottomless-cli -e http://localhost:9000 -n ns-:default -d e4e57664-01ad-76cc-9f19-a96700d5b2e4 verify
Snapshot size: 13512704
Verification: ok

Refs #717

psarna added 2 commits October 6, 2023 13:36
The way create_dir_all() is called on a path to the database,
it also creates the final file name as a directory. As a result,
restoration later fails, because `data.tmp` cannot be moved to `data`,
with `data` being already mistakenly created as a directory.
The command works similarly to `restore`, except it restores
to a temporary directory and runs a `pragma integrity_check` query.

On success it should return:
```
bottomless-cli -e http://localhost:9000 -n ns-:default -d e4e57664-01ad-76cc-9f19-a96700d5b2e4 verify
Snapshot size: 13512704
Verification: ok
```
@psarna psarna requested a review from penberg October 6, 2023 11:38
@psarna psarna merged commit 33bca7b into libsql:main Oct 6, 2023
7 of 8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants