From 09525eb8aae8801468a75b867361106f6f830e7c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 20 Mar 2022 01:46:27 +0100 Subject: 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. --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.rs') 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, + exclude_column: Option>, }, } @@ -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(), }; -- cgit v1.2.3