You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
optima-query-db only takes single-statement SQL from argv (the CLI surface), so it doesn't hit the multi-line newline-truncation that broke grant-balance silently. Scope was tightened to keep PR #8 focused on the breaking bug.
Why it should still be fixed
Consistency — three helpers (db-utils, query-db, show-env) all touch shell escaping; aligning them on the same execFileSync(psql, argv) + tmpfile pattern removes a class of foot-guns.
Latent risk — if someone later pastes a multi-line query (e.g. CTE with comments) into optima-query-db, it would partially execute on Windows the same way grant-balance did.
Follow-up from PR #8
bin/helpers/query-db.ts:230still uses thepsql -c "<sql>"pattern that PR #8 replaced indb-utils.ts:Why this wasn't fixed in PR #8
optima-query-dbonly takes single-statement SQL fromargv(the CLI surface), so it doesn't hit the multi-line newline-truncation that broke grant-balance silently. Scope was tightened to keep PR #8 focused on the breaking bug.Why it should still be fixed
db-utils,query-db,show-env) all touch shell escaping; aligning them on the sameexecFileSync(psql, argv)+ tmpfile pattern removes a class of foot-guns.optima-query-db, it would partially execute on Windows the same way grant-balance did.ON_ERROR_STOP=1— same reason as PR fix: multiple Windows shell-compat bugs in dev-skills CLI #8: psql with-cswallows non-fatal errors and still returns 0.Proposed fix
Mirror the
queryDBrewrite from PR #8 commit7ce79bf:fs.writeFileSync+os.tmpdir()execFileSync(psql, ['-h', ..., '-v', 'ON_ERROR_STOP=1', '-f', tmpFile], {...})finallyblockEstimated effort: 5 min + smoke test.
Refs: PR #8, commit 7ce79bf