Repository navigation
fix(engine): cast the value in the repeated-parameter error's example - #14
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the change to the reylo3 repeated-parameter diagnostic's example, which now casts the value in the suggested with.
- Diagnostic text —
repeated()inengine/core/src/lex.rsnow suggestswith input as (select :x::<type> as x) select … from input, with a comment on why a bare parameter in a select list is untyped on each dialect. - The
::<type>form works on every dialect —engine/core/src/structured.rsrewrites a::typeafter a parameter into MySQL's and SQLite's ownCAST, so following the suggestion works on all three dialects, not just Postgres. - Fixtures — the lex unit tests,
tests/analyze.test.ts, and theparams_once,sqlite_params_once,sqlite_insertsandmysql_typesoracle outputs all match the new text. No other copy of the message (README or docs) needed updating. - Artifacts — the three
engine.wasmbuilds were regenerated for core's new fingerprint.
claude-opus-5-5 | 𝕏
The error suggested `with input as (select :id as id)`, which no dialect types: Postgres reads a bare parameter in a select list as text, MySQL as a string, and SQLite leaves it untyped. The example now casts it, `select 🆔:<type> as id`.
colinhacks
force-pushed
the
fix-repeated-param-cast
branch
from
October 22, 2026 17:24
452c4e9 to
cb9c1d0
Compare
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.

A parameter used twice is an error whose message suggests reading it once through a
with:Followed as written, that rewrite fails on every dialect, because nothing types a bare parameter in a select list:
text:with input as (select :id as id) select c.* from book_comments c, input where c.id = input.id or c.user_id = input.idis "operator does not exist: integer = text (42883)".strict_params.With a cast (
select :id::int as id), each dialect types it. The message now says so:engine/core/src/lex.rs: the message and its unit test.tests/analyze.test.tsand the oracle cases that record the message (params_once,sqlite_params_once,sqlite_inserts,mysql_types).engine.wasmartifacts, rebuilt for core's new fingerprint.Checked locally: the Rust build and engine tests, the oracle on Postgres 18, SQLite and MySQL 8.4, the wasm fingerprints, the typecheck, and the loader tests (192 passing, none skipped).