mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 14:00:31 +08:00
radicle: Consolidate databases
Instead of having a routing database, and an addresses database, consolidate that in a single database called `node.db`. We also simplify database access, by providing a single type for opening the database, and use traits to access the various functions. We create a new `seed::Store` that has seed-related methods split out of the `address::Store`. Note that tracking is still in its own database currently, as it isn't ephemeral state. This makes it easy to delete the new `node.db` without risk of losing any important information. To avoid renaming all database methods, we create a `Stores` wrapper that allows us to access routing, addresses, seeds etc. without type ambiguity. This is a breaking change and requires `addresses.db` and `routing.db` to be deleted.
This commit is contained in:
@@ -3,7 +3,7 @@ use std::time;
|
||||
|
||||
use anyhow::anyhow;
|
||||
|
||||
use radicle::node::{Address, Node, NodeId, PeerAddr, ROUTING_DB_FILE};
|
||||
use radicle::node::{Address, Node, NodeId, PeerAddr};
|
||||
use radicle::prelude::Id;
|
||||
|
||||
use crate::terminal as term;
|
||||
@@ -249,8 +249,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||
events::run(node, count, timeout)?;
|
||||
}
|
||||
Operation::Routing { rid, nid, json } => {
|
||||
let store =
|
||||
radicle::node::routing::Table::reader(profile.home.node().join(ROUTING_DB_FILE))?;
|
||||
let store = profile.database()?;
|
||||
routing::run(&store, rid, nid, json)?;
|
||||
}
|
||||
Operation::Logs { lines } => control::logs(lines, Some(time::Duration::MAX), &profile)?,
|
||||
|
||||
Reference in New Issue
Block a user