diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-02 01:39:19 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-02 01:39:19 -0700 |
commit | 5a9333475518c3a7d9396d120e07d813252a0a09 (patch) | |
tree | d38b3faa7e334e7674f6819f855b5dbbcb9eb180 /adenosine-pds/src/repo.rs | |
parent | f3fdc7ba600c65fdb05efc2fd5e9a651b4b9956e (diff) | |
download | adenosine-5a9333475518c3a7d9396d120e07d813252a0a09.tar.gz adenosine-5a9333475518c3a7d9396d120e07d813252a0a09.zip |
pds: refactoring
Diffstat (limited to 'adenosine-pds/src/repo.rs')
-rw-r--r-- | adenosine-pds/src/repo.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/adenosine-pds/src/repo.rs b/adenosine-pds/src/repo.rs index e5de504..713210e 100644 --- a/adenosine-pds/src/repo.rs +++ b/adenosine-pds/src/repo.rs @@ -35,6 +35,12 @@ impl RepoStore { }) } + pub fn new_connection(&mut self) -> Result<Self> { + Ok(RepoStore { + db: self.db.additional_connection()?, + }) + } + pub fn get_ipld(&mut self, cid: &str) -> Result<Ipld> { let ipld_cid = Cid::from_str(cid)?; if let Some(b) = self.db.get_block(&ipld_cid)? { @@ -67,7 +73,7 @@ impl RepoStore { } /// Quick alias lookup - pub fn get_root(&mut self, did: &str) -> Result<Option<String>> { + pub fn lookup_commit(&mut self, did: &str) -> Result<Option<String>> { Ok(self .db .resolve(Cow::from(did.as_bytes()))? |