aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs2
-rw-r--r--src/main.rs15
2 files changed, 15 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 3f6151e..4f1b44d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,7 +3,7 @@ pub mod sqlite;
pub mod yaml;
-pub use select::select;
+pub use select::*;
#[derive(thiserror::Error, Debug)]
diff --git a/src/main.rs b/src/main.rs
index d3c286b..6c87a0b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -79,7 +79,20 @@ fn main() {
} => {
let dbconn = rusqlite::Connection::open(database).unwrap();
- yaqlite::select(&dbconn, &table_name, &record_id).unwrap();
+ match primary_key {
+ Some(pk) => yaqlite::select_by_column(
+ &dbconn,
+ &table_name,
+ &pk,
+ &record_id,
+ ).unwrap(),
+
+ None => yaqlite::select(
+ &dbconn,
+ &table_name,
+ &record_id,
+ ).unwrap(),
+ };
dbconn.close().unwrap();
},