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" <