Skip to content

fix(where): make reserved-word, dotted, and non-ASCII column names addressable - #64

Merged
yusukebe merged 1 commit into
mainfrom
fix/where-column-names
Aug 4, 2026
Merged

fix(where): make reserved-word, dotted, and non-ASCII column names addressable#64
yusukebe merged 1 commit into
mainfrom
fix/where-column-names

Conversation

@yusukebe

@yusukebe yusukebe commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #59, taking all three asks:

  1. Backticked names get their own marker (quoted on the lexer token): they skip the true/false/null literal conversion — `true` ~ /yes/ now addresses a column named true — and are never dot-split. Bare keywords keep their literal meaning.
  2. A bare dotted name prefers a literal column: the parser remembers the raw spelling (foo.bar) and resolution tries row["foo.bar"] before path traversal. The issue's silent false negative (foo.bar ~ /x/ → 0 rows) and false positive (foo.bar == null → match) are both gone; rows without such a key fall through to normal path resolution, so tags.length, name.length, and genuine nested access are unaffected (pinned by the existing "dot paths and .length" test plus new both-readings-exist coverage where the literal wins).
  3. Docs generalized--help, src/agent-context.txt, and the grammar comment now state the real rule: bare references are ASCII identifiers, a dot prefers a literal column then traverses, and backticks are for everything else (spaces, punctuation, non-ASCII, leading digits, reserved words). Non-ASCII names keep failing loudly when bare (cannot parse expression near) and work backticked.

Tests

5 new expr tests: backticked keywords as columns (bare ones stay literals), dotted-name literal-first with fallback and precedence, backticked names never dot-split, and a non-ASCII (CJK) header. All three issue repros verified end-to-end through the CLI. bun test test/: 162 pass, tsc --noEmit and oxfmt --check clean.

🤖 Generated with Claude Code

…dressable

Backticked names get a verbatim marker: they are never dot-split and never
converted to the true/false/null literals, so `true` is now a column
reference. A bare dotted name prefers a column literally so named (a header
called foo.bar) and falls back to path traversal, keeping tags.length and
nested access working. Docs generalize the backtick rule beyond 'headers
with spaces'.

Closes #59

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yusukebe
yusukebe merged commit a6f1c33 into main Aug 4, 2026
3 checks passed
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.

--where: reserved-word and dotted column names are unaddressable, and the backtick rule is documented too narrowly

1 participant