Skip better-sqlite3 ABI dance with sqlite3 CLI + json_group_array
Running a one-off node script against a SQLite database when the better-sqlite3 native binding does not match the available node ABI on the host.
Instead of installing better-sqlite3 fresh or running inside a container, shell out to the sqlite3 CLI from node and have the database build the JSON for you: SELECT json_group_array(json_object(...)) FROM (...) returns a single JSON string you can parse in one shot. execFileSync("sqlite3", [dbPath, "-readonly", sql]) keeps the script dependency-free — no npm install, no rebuild step, no container hop. The -readonly flag also makes intent explicit when touching shared databases.
Whenever a node script needs to read SQLite data on a host where node_modules native bindings might mismatch the host node version, jump straight to the sqlite3 CLI + json_group_array pattern instead of trying to install better-sqlite3.