aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/db.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-01 19:44:09 -0700
committerBryan Newbold <bnewbold@robocracy.org>2022-11-01 19:44:09 -0700
commitf3fdc7ba600c65fdb05efc2fd5e9a651b4b9956e (patch)
treecf2522e44a56fb621a5e72364951ab7a1c29ef45 /adenosine-pds/src/db.rs
parent96c6dbc6c500a7ca3ebefe4ee4fb91fcb8c1713c (diff)
downloadadenosine-f3fdc7ba600c65fdb05efc2fd5e9a651b4b9956e.tar.gz
adenosine-f3fdc7ba600c65fdb05efc2fd5e9a651b4b9956e.zip
pds: refactor repo code
Diffstat (limited to 'adenosine-pds/src/db.rs')
-rw-r--r--adenosine-pds/src/db.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/adenosine-pds/src/db.rs b/adenosine-pds/src/db.rs
index 1d6d4ed..905210c 100644
--- a/adenosine-pds/src/db.rs
+++ b/adenosine-pds/src/db.rs
@@ -61,7 +61,7 @@ impl AtpDatabase {
pub fn get_record(&mut self, did: &str, collection: &str, tid: &str) -> Result<Value> {
let mut stmt = self.conn.prepare_cached(
- "SELECT record_json FROM record WHERE did = ?1 collection = ?2 tid = ?3",
+ "SELECT record_json FROM record WHERE did = ?1 AND collection = ?2 AND tid = ?3",
)?;
Ok(stmt.query_row(params!(did, collection, tid), |row| {
row.get(0).map(|v: String| Value::from_str(&v))
@@ -71,7 +71,7 @@ impl AtpDatabase {
pub fn get_record_list(&mut self, did: &str, collection: &str) -> Result<Vec<String>> {
let mut stmt = self
.conn
- .prepare_cached("SELECT tid FROM record WHERE did = ?1 collection = ?2")?;
+ .prepare_cached("SELECT tid FROM record WHERE did = ?1 AND collection = ?2")?;
let ret = stmt
.query_and_then(params!(did, collection), |row| {
let v: String = row.get(0)?;