From cb96de6125c6005b7f53c5b2a53b811599600e4f Mon Sep 17 00:00:00 2001 From: yukkop Date: Tue, 23 Dec 2025 18:30:26 +0000 Subject: [PATCH] fix(`package`): `migrator`: handle sqlite posible settings --- package/migrator/migrator.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/package/migrator/migrator.sh b/package/migrator/migrator.sh index a0bbb82..45d3071 100644 --- a/package/migrator/migrator.sh +++ b/package/migrator/migrator.sh @@ -80,7 +80,8 @@ db_exec() { sqlite) local db_path db_path=$(get_sqlite_path) - printf '%s' "$sql" | sqlite3 "$db_path" + # Use -batch for non-interactive execution + printf '%s' "$sql" | sqlite3 -batch "$db_path" ;; esac } @@ -98,7 +99,8 @@ db_query() { sqlite) local db_path db_path=$(get_sqlite_path) - sqlite3 "$db_path" "$sql" + # Use -noheader -list for clean output (one value per line, no formatting) + sqlite3 -noheader -list "$db_path" "$sql" | awk NF ;; esac } @@ -124,7 +126,7 @@ SQL sqlite) local db_path db_path=$(get_sqlite_path) - sqlite3 "$db_path" <