summaryrefslogtreecommitdiff
path: root/src/cmd/show_gen.rs
AgeCommit message (Collapse)AuthorFilesLines
2022-10-23refactor: use clap instead of structoptLars Wirzenius1-3/+3
clap version 3 basically replaces structopt entirely. Sponsored-by: author
2022-05-03refactor: add a type for plain integers we store in a databaseLars Wirzenius1-2/+3
This will make it easier to change later, if need be. We may want to do that for various reasons, such as to save space. We may also want to change things to only use integer types that SQLite can handle: u64 is currently not well handled by our database layer. However, as this is a refactor, there's no change or fix to that. FileId is now explicitly a database integer. This doesn't break anything, for now, as the underlying integer type is still u64. Also, change a couple of places where it will matter if DbInt changes away from u64, and disable warnings for harmless conversions that may cause warnings depending on what type DbInt has. Sponsored-by: author
2022-04-21feat: show-generation shows size of the generation's SQLite dbLars Wirzenius1-0/+9
Sponsored-by: author
2022-04-21feat: change "show-generation" output to JSONLars Wirzenius1-4/+34
This is more friendly towards anyone wanting to use the output in a script. Sponsored-by: author
2022-03-22feat! store list of generations in a "client trust root" chunkLars Wirzenius1-1/+7
Backups made with this version can't be restored with old clients, and vice version. Sponsored-by: author
2022-03-06refactor: use new database abstraction for generationsLars Wirzenius1-2/+1
Sponsored-by: author
2022-01-16refactor: rename AsyncBackupClient to just BackupClientLars Wirzenius1-2/+2
There is only async. Sponsored-by: author
2021-12-31docs: add documentation comments to crateLars Wirzenius1-0/+5
Also, make it an error for a public symbol to not be documented. Sponsored-by: author
2021-08-01refactor: add a type alias for generation idsLars Wirzenius1-1/+1
This will make it harder to accidentally use a string. Can still be confused with a chunk id. Sponsored-by: author
2021-07-23refactor: async for "obnam show-generation"Lars Wirzenius1-5/+10
Sponsored-by: author
2021-04-26Extend the iterator to users of LocalGeneration::files()Alexander Batischev1-2/+3
2021-04-26Expose fallibility of individual SQL resultsAlexander Batischev1-7/+10
`LocalGeneration::sql::files()` runs an SQL query, iterates over the results and collects the rows into a `Vec`. This can fail at any step: the query might fail to run, or one of the rows might fail to be fetched or processed. Right now, we lump all those failures into a `Result` that wraps the whole return value. This is only possible because we process each row before returning. Once `Vec` is replaced by an iterator, we won't have that luxury anymore, so we now wrap each individual element into its own `Result` (as well as wrapping the whole vector into a `Result` of its own).
2021-04-10refactor: struct ShowGeneration subcommandLars Wirzenius1-20/+29
2021-04-10refactor: move ClientConfig into its own moduleLars Wirzenius1-1/+1
2021-03-03fix: allow generation temporary files to be automatically deletedLars Wirzenius1-11/+2
By not calling NamedTempFile::persist, the files get deleted automatically when the file is closed or the struct is dropped. Previously we were deleting the temporary files manually, which meant that sometimes they weren't deleted if the program crashed at an unfortunate time.
2021-02-06feat: client verifies server's TLS certificate by defaultLars Wirzenius1-1/+1
Configuration setting can disable it.
2021-02-04refactor: have per-module error enumsLars Wirzenius1-6/+2
This means that a function that parses step bindings can't return an error that the document is missing a title. Such an error return would be nonsensical, and we use the Rust type system to prevent it, at a small cost of being a bit verbose. Additional benefit is that the library portion of Obnam doesn't return anyhow::Result values anymore.
2021-01-16feat: add "obnam show-generation" subcommandLars Wirzenius1-0/+46