Fix purge-chain and print DB info on startup (#5840)

* purge-chain accepts --db option

* print DB info on startup

* Small refactoring

* Added back &self

* Add DatabaseParams for PurgeChain, ImportParams and ExportBlocks

* Don't force default value

* Remove unused fields

* Update client/cli/src/commands/export_blocks_cmd.rs

* Fix stuff

Co-authored-by: Cecile Tonglet <cecile@parity.io>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Arkadiy Paronyan
2020-04-30 14:53:04 +02:00
committed by GitHub
parent db2e916904
commit c3a6d8a881
10 changed files with 142 additions and 93 deletions
+12
View File
@@ -317,6 +317,18 @@ impl DatabaseSettingsSrc {
}
}
impl std::fmt::Display for DatabaseSettingsSrc {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let name = match self {
DatabaseSettingsSrc::RocksDb { .. } => "RocksDb",
DatabaseSettingsSrc::ParityDb { .. } => "ParityDb",
DatabaseSettingsSrc::SubDb { .. } => "SubDb",
DatabaseSettingsSrc::Custom(_) => "Custom",
};
write!(f, "{}", name)
}
}
pub(crate) mod columns {
pub const META: u32 = crate::utils::COLUMN_META;
pub const STATE: u32 = 1;