summaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/db.rs
diff options
context:
space:
mode:
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)?;