Skip to content

Commit

Permalink
Deprecate "paritydb-experimental" CLI in favour or "paritydb" (parity…
Browse files Browse the repository at this point in the history
…tech#10975)

* Deprecate paritydb-experimental

* Updated comment
  • Loading branch information
arkpar authored and grishasobol committed Mar 28, 2022
1 parent 07fb82f commit 3f3be38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/cli/src/arg_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ pub enum Database {
/// ParityDb. <https://github.com/paritytech/parity-db/>
ParityDb,
/// Detect whether there is an existing database. Use it, if there is, if not, create new
/// instance of paritydb
/// instance of ParityDb
Auto,
/// ParityDb. <https://github.com/paritytech/parity-db/>
ParityDbDeprecated,
}

impl std::str::FromStr for Database {
Expand All @@ -212,6 +214,8 @@ impl std::str::FromStr for Database {
if s.eq_ignore_ascii_case("rocksdb") {
Ok(Self::RocksDb)
} else if s.eq_ignore_ascii_case("paritydb-experimental") {
Ok(Self::ParityDbDeprecated)
} else if s.eq_ignore_ascii_case("paritydb") {
Ok(Self::ParityDb)
} else if s.eq_ignore_ascii_case("auto") {
Ok(Self::Auto)
Expand All @@ -224,7 +228,7 @@ impl std::str::FromStr for Database {
impl Database {
/// Returns all the variants of this enum to be shown in the cli.
pub fn variants() -> &'static [&'static str] {
&["rocksdb", "paritydb-experimental", "auto"]
&["rocksdb", "paritydb", "paritydb-experimental", "auto"]
}
}

Expand Down
7 changes: 7 additions & 0 deletions client/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
Ok(match database {
Database::RocksDb => DatabaseSource::RocksDb { path: rocksdb_path, cache_size },
Database::ParityDb => DatabaseSource::ParityDb { path: paritydb_path },
Database::ParityDbDeprecated => {
eprintln!(
"WARNING: \"paritydb-experimental\" database setting is deprecated and will be removed in future releases. \
Please update your setup to use the new value: \"paritydb\"."
);
DatabaseSource::ParityDb { path: paritydb_path }
},
Database::Auto => DatabaseSource::Auto { paritydb_path, rocksdb_path, cache_size },
})
}
Expand Down

0 comments on commit 3f3be38

Please sign in to comment.