aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2022-03-19 04:15:43 +0100
committerTeddy Wing2022-03-19 04:15:43 +0100
commitc00534e648da45b8e925c777c96200d55a82d01d (patch)
treef65af57b94a2e77ded9785cbd5039423ed3e1e4f
parenta28ddc0da43ef01774c1816a2be5786ae0c52953 (diff)
downloadyaqlite-c00534e648da45b8e925c777c96200d55a82d01d.tar.bz2
select(): Don't include the primary key in the `Yaml` hash
The primary key shouldn't be editable, so don't include it in the resulting YAML.
-rw-r--r--src/select.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/select.rs b/src/select.rs
index d3dc9f0..d5bab23 100644
--- a/src/select.rs
+++ b/src/select.rs
@@ -50,6 +50,10 @@ pub fn select(
let mut data = yaml_rust::yaml::Hash::new();
for (i, column) in column_names.iter().enumerate() {
+ if column == "id" {
+ continue
+ }
+
let column_name = column.to_owned();
let column_value: Yaml = row.get(i)?;