mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 23:21:06 +00:00
New database trait (#5549)
* Introduce trait * The trait * Generic * Basic impls. * Remove unneeded bounds * Minor changes * Switch over to the new DB trait * Integrated parity-db and added CLI for db selection * Default impl. * Fix logs. * Started integrating subdb * Apply suggestions from code review Co-Authored-By: Cecile Tonglet <cecile@parity.io> * Apply suggestions from code review Co-Authored-By: Nikolay Volf <nikvolf@gmail.com> * Enable subdb * Bump parity-db * Fixed CLI macro * Fixed browser build * Fixed features * Sort out features * Use parity-db from crates.io * Typo Co-authored-by: arkpar <arkady.paronyan@gmail.com> Co-authored-by: Cecile Tonglet <cecile@parity.io> Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ js-sys = "0.3.34"
|
||||
wasm-bindgen = "0.2.57"
|
||||
wasm-bindgen-futures = "0.4.7"
|
||||
kvdb-web = "0.5"
|
||||
sp-database = { version = "2.0.0-dev", path = "../../primitives/database" }
|
||||
sc-informant = { version = "0.8.0-dev", path = "../../client/informant" }
|
||||
sc-service = { version = "0.8.0-dev", path = "../../client/service", default-features = false }
|
||||
sc-network = { path = "../../client/network", version = "0.8.0-dev"}
|
||||
|
||||
@@ -70,7 +70,7 @@ where
|
||||
info!("Opening Indexed DB database '{}'...", name);
|
||||
let db = kvdb_web::Database::open(name, 10).await?;
|
||||
|
||||
DatabaseConfig::Custom(Arc::new(db))
|
||||
DatabaseConfig::Custom(sp_database::as_database(db))
|
||||
},
|
||||
keystore: KeystoreConfig::InMemory,
|
||||
default_heap_pages: Default::default(),
|
||||
|
||||
@@ -26,5 +26,5 @@ structopt = "0.3.8"
|
||||
codec = { version = "1.3.0", package = "parity-scale-codec" }
|
||||
|
||||
[features]
|
||||
default = ["rocksdb"]
|
||||
rocksdb = ["sc-client-db/kvdb-rocksdb"]
|
||||
default = ["db"]
|
||||
db = ["sc-client-db/kvdb-rocksdb", "sc-client-db/parity-db"]
|
||||
|
||||
Reference in New Issue
Block a user