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
fix: resolve all v0.20.0 binary bugs (#433-#485) and prepare v0.21.0 (#486)
* fix: resolve all v0.20.0 binary bugs (#433-#485) and prepare v0.21.0
Resolve the v0.20.0 hardening bugs tracked under the roadmap (#148), grouped
by theme, each with Go regression tests and shellspec binary-level coverage.
Breaking changes:
- Reject explicit transaction control, VACUUM/VACUUM INTO, and ATTACH/DETACH
with a clear sqly error: each statement runs in its own transaction on a
single in-memory connection, so they cannot work across statements, and
ATTACH would write external SQLite files outside the import/save model
(#441, #442, #443, #444, #457, #458, #463).
- Reject a non-interactive --save/--save-dir run whose SQL changes schema or
runs a maintenance statement (ALTER/DROP/REINDEX/ANALYZE, CREATE/DROP of a
table/view/index/trigger, CTAS), since write-back can only persist DML on
imported tables (#433-#438, #469-#484).
Bug fixes:
- Report neutral success for a no-rowset DDL/PRAGMA/maintenance statement
instead of a misleading affected-row count (#439).
- Run setter and no-row command PRAGMAs on the exec path (#440, #485).
- Allow a batch/--sql-file script that imports its own input with .import and
then modifies it under save flags (#456).
- Accept schema-qualified names in .schema/.describe/.header/.dump (#445-#448).
- List session views and TEMP tables in .tables; print CREATE VIEW for a view
and the stored DDL for a constrained TEMP table (#449, #450, #451, #464).
- Import empty compressed JSON/JSONL as zero-row tables (#452, #453).
- Strip all compression suffixes before the ACH/Fedwire output guard
(#459, #460).
- Accept /dev/stdin, /dev/stdout, /dev/stderr, and /proc/<pid|self>/fd/* input
paths (#461, #462).
- Validate LTSV labels on output and reject duplicate labels on output and
import (#465, #466, #467).
- Keep a multiline CREATE TRIGGER body as one statement in batch/--sql-file
parsing (#468).
* fix: import pseudo-files end-to-end and adopt upstream LTSV root fix
Address review follow-ups on the v0.20.0 hardening work:
- #461/#462: a pseudo-file input (/dev/stdin, /dev/stdout, /dev/stderr,
/proc/<pid|self>/fd/*) now imports end-to-end, not just passing path
validation. An extensionless pseudo-file is staged as CSV; use
--stdin FORMAT for another format.
- #467: bump filesql to v0.14.0, which rejects a duplicate label within
an LTSV record on import (upstream root fix via fileparser v0.5.2), and
remove the temporary sqly-side duplicate-label check. The regression
tests now exercise filesql's rejection.
- Fix a doc comment that named the wrong test function (CodeRabbit).
* Unsupported Statements Rejected Clearly: Explicit transaction control (`BEGIN`/`COMMIT`/`ROLLBACK`/`SAVEPOINT`/`RELEASE`), `VACUUM`/`VACUUM INTO`, and `ATTACH`/`DETACH DATABASE` are now rejected with a clear sqly error. sqly runs each statement in its own transaction on a single in-memory connection, so these cannot work across statements, and ATTACH would let a session read or write external SQLite files outside the import/save model (#441, #442, #443, #444, #457, #458, #463).
7
+
* Write-Back Rejects Schema-Only Runs: A non-interactive `--save`/`--save-dir` run now fails up front when the SQL changes schema or runs a maintenance statement (ALTER, DROP, REINDEX, ANALYZE, CREATE/DROP of a table/view/index/trigger, including `CREATE TABLE AS SELECT`), since write-back can only persist `INSERT`/`UPDATE`/`DELETE` on imported tables. Previously such a run exited 0 and reported success while leaving the source unchanged (#433, #434, #435, #436, #437, #438, #469, #470, #471, #472, #473, #474, #475, #476, #477, #478, #479, #480, #481, #482, #483, #484).
8
+
9
+
### Bug Fixes
10
+
* Neutral Result Message For Non-DML: A DDL, PRAGMA, or maintenance statement now reports `statement executed successfully` instead of a misleading `affected is N row(s)` count (#439).
11
+
* PRAGMA On The Exec Path: A setter PRAGMA (`PRAGMA user_version = 1`) and a no-row command PRAGMA (`PRAGMA incremental_vacuum`) now run successfully instead of failing with a "no records" error (#440, #485).
12
+
* Batch .import Under Save Flags: A batch or `--sql-file` script that imports its own input with `.import` and then modifies it is now allowed under `--save`/`--save-dir`; write-back is validated after the import runs (#456).
13
+
* Schema-Qualified Helper Commands: `.schema`, `.describe`, `.header`, and `.dump` accept schema-qualified names such as `main.user` (#445, #446, #447, #448).
14
+
* TEMP Tables And Views In Helper Commands: `.tables` lists session-created views and TEMP tables (#449, #450); `.schema` prints the real `CREATE VIEW` for a view (#451) and reads the stored definition for a constrained TEMP table instead of a lossy reconstruction (#464).
15
+
* Empty Compressed JSON And JSONL: An empty compressed JSON array (`.json.gz`) and an empty compressed JSONL file now import as a zero-row table, matching the uncompressed inputs (#452, #453).
16
+
* Output Destination Safety: `--output` and `.dump` strip every trailing compression suffix before checking for an input-only ACH/Fedwire extension, so a path like `out.ach.gz.zst` is rejected instead of receiving CSV bytes (#459, #460).
17
+
* Pseudo-File Inputs: `/dev/stdin`, `/dev/stdout`, `/dev/stderr`, and the Linux `/proc/<pid|self>/fd/*` aliases pass input-path validation and import end-to-end. An extensionless pseudo-file is staged as CSV (use `--stdin FORMAT` for another format), matching the already-allowed `/dev/fd/*` (#461, #462).
18
+
* LTSV Label Validation: LTSV output rejects a column name that is not a valid LTSV label (for example `foo:bar`) or that duplicates another, and LTSV import rejects a row that repeats a label, so LTSV stays round-trippable instead of silently losing values (#465, #466, #467).
19
+
* Multiline CREATE TRIGGER: Batch and `--sql-file` parsing keeps a `CREATE TRIGGER ... BEGIN ... END` body as one statement instead of splitting it at the inner semicolons (#468).
20
+
21
+
### Dependencies
22
+
* filesql: 0.13.0 → 0.14.0, which rejects a duplicate label within an LTSV record on import (the upstream root fix for #467, replacing the temporary sqly-side check) and pulls in fileparser 0.5.2.
0 commit comments