aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorTeddy Wing2022-03-20 01:46:27 +0100
committerTeddy Wing2022-03-20 01:48:32 +0100
commit09525eb8aae8801468a75b867361106f6f830e7c (patch)
tree9526332d13d602eb724eb574ce07f1c99b403a9d /src/main.rs
parentf30a4dafa5736c58bda54569ec9f46e6fdb2e200 (diff)
downloadyaqlite-09525eb8aae8801468a75b867361106f6f830e7c.tar.bz2
select: Exclude primary key column unless given excluded columns
If no excluded columns are given, exclude the primary key column by default. Otherwise, exclude only those columns in the `exclude_columns` list.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 0fe52aa..1d918d0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -32,7 +32,7 @@ enum Command {
record_id: String,
#[clap(long)]
- exclude_column: Vec<String>,
+ exclude_column: Option<Vec<String>>,
},
}
@@ -85,14 +85,14 @@ fn main() {
&table_name,
&pk,
&record_id,
- &exclude_column,
+ exclude_column.as_deref(),
).unwrap(),
None => yaqlite::select(
&dbconn,
&table_name,
&record_id,
- &exclude_column,
+ exclude_column.as_deref(),
).unwrap(),
};