Skip to content

fix: match on-file keys to DDL columns case-insensitively - #1604

Merged
thekevinbot merged 5 commits into
mainfrom
bot/1587-hook-key-case-1104
Nov 4, 2026
Merged

thekevinbot merged 5 commits into
mainfrom
bot/1587-hook-key-case-1104

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

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-file command (shape_json_rows) and SDK Table closures (normalize_against, plus its emitted marking), in relaxed and strict tables. Previously {"title":...} into CREATE 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.md updated 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) and Windows tests fail only in hook_key_case (left: Null, right: Text("hello"); strict: Schema mismatch: extra columns not in table posts: title) and hook_key_case_e2e ([{"TITLE":null}] vs [{"TITLE":"hello"}]).

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: pass (impacted subset)
  • TypeScript SDK e2e: pass (full suite)
  • Rust core e2e (if applicable): pass (hook_key_case_e2e)
  • packages/python/e2e-attestations/<branch>.json receipt written if packages/python changed (just e2e-attest-python)
  • packages/ts/e2e-attestations/<branch>.json receipt written if packages/ts changed (just e2e-attest-ts)
  • Command(s) run: 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
  • Result summary: Python 17 passed; TS 19 passed; Rust new tests 6 passed. Hand check with the release binary: the issue repro prints [{"TITLE":"hello"}] relaxed and strict; strict still rejects a genuinely extra key. Python SDK Table(on_file=...) returns {'TITLE': 'hello'} relaxed and strict.

Changelog / Migrations

  • Changelog fragment added under <root>/<pkg>/changelog.d/ for each changed package (or: skip-changelog trailer on a commit with reason)
  • Migration fragment with the same slug added under <root>/<pkg>/migrations.d/ for each changed package (every subsection but Summary _None._ when nothing breaks)

@thekevinbot
thekevinbot merged commit 1b1aac6 into main Nov 4, 2026
90 checks passed
@thekevinbot
thekevinbot deleted the bot/1587-hook-key-case-1104 branch November 4, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Match hook keys to declared DDL columns case-insensitively

1 participant