Repository navigation
fix: match on-file keys to DDL columns case-insensitively - #1604
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1587
A hook key now fills the declared column it names under SQLite's identifier rule (case-insensitive for ASCII letters only), for both the config
on-filecommand (shape_json_rows) and SDKTableclosures (normalize_against, plus itsemittedmarking), in relaxed andstricttables. Previously{"title":...}intoCREATE TABLE posts (TITLE TEXT)was a silent NULL, and a strict table rejected it as an extra + missing column. An exact-case key wins over a case variant.docs/reference/config.mdupdated to state the rule.Sibling: #1590 (schema inference on keys differing only by case) is in the same case-handling area and is left for its own PR.
Red run
Test-only head
cfb5a00f: https://github.com/thekevinscott/dirsql/actions/runs/41879228357 --Integration tests(Linux) andWindows testsfail only inhook_key_case(left: Null, right: Text("hello"); strict:Schema mismatch: extra columns not in table posts: title) andhook_key_case_e2e([{"TITLE":null}]vs[{"TITLE":"hello"}]).E2E Verification
hook_key_case_e2e)packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written ifpackages/tschanged (just e2e-attest-ts)uv run maturin develop --release;cargo build --release -p dirsql --features cli;cd packages/python && testing-conventions e2e attest 'uv run python -m pytest tests/e2e/on_file_query_test.py tests/e2e/declared_table_name_test.py tests/e2e/query_contract_test.py tests/e2e/jsonl_parse_speed_test.py tests/e2e/frontmatter_parse_speed_test.py -x -q';just e2e-attest-ts;cargo test -p dirsql --features cli --test hook_key_case --test hook_key_case_e2e[{"TITLE":"hello"}]relaxed and strict; strict still rejects a genuinely extra key. Python SDKTable(on_file=...)returns{'TITLE': 'hello'}relaxed and strict.Changelog / Migrations
<root>/<pkg>/changelog.d/for each changed package (or:skip-changelogtrailer on a commit with reason)<root>/<pkg>/migrations.d/for each changed package (every subsection but Summary_None._when nothing breaks)