Skip to content

Preserve precise rows for grammar-proven repeated inputs - #229

Merged
Lojhan merged 1 commit into
mainfrom
feat/repeated-input-type-evidence
Oct 29, 2026
Merged

Lojhan merged 1 commit into
mainfrom
feat/repeated-input-type-evidence

Conversation

@Lojhan

@Lojhan Lojhan commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Dynamic mapped lists currently widen every result property to SQL-nullable unknown, including an ordinary WHERE id IN (...) or bulk INSERT ... VALUES ... RETURNING. Preserve the selected grammar's inferred results when its AST proves that every repeated range supplies scalar inputs. PostgreSQL, MySQL, and SQLite certify scalar IN lists in top-level SELECT predicates and scalar VALUES rows. Other placements retain the conservative fallback.

The compiler passes SQL ranges through the optional dialect analysis context and keys cached analysis by those ranges as well as SQL text. Identical representative SQL from an input list and a repeated JSON projection therefore cannot share incompatible evidence. RETURNING column locations also map through expanded SQL, preserving editor source navigation.

Delimiter checks now consume each list's closing token explicitly and distinguish punctuation from a closing-parenthesis string literal. Nested calls no longer steal an outer closing token or make a missing delimiter appear valid.

Validation: full pnpm verify passed, including coverage, packed consumers and editor type checks, docs contracts/build, performance budgets, and soak checks. The shared three-grammar corpus asserts result types, ordered parameter patterns, diagnostics, and source spans in both compilation modes. Regressions cover both cache orders, actual runtime plan selection at cardinality three, absent evidence, repeated RETURNING projections, literal delimiters, and the existing JSON cardinality counterexamples. Includes package Changesets and documentation.

@Lojhan
Lojhan marked this pull request as ready for review October 29, 2026 00:10
@Lojhan
Lojhan merged commit f51b53d into main Oct 29, 2026
22 checks passed
@Lojhan
Lojhan deleted the feat/repeated-input-type-evidence branch October 29, 2026 01:04
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.

1 participant