Repository navigation
feat!: leave the sqlcommenter comment out of .sql - #135
Merged
Merged
Conversation
Reylo still sends each statement with the comment naming its file; the query's sql is the compiled statement alone, and its hover shows it once.
|
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
This review covers the whole PR: the sqlcommenter comment now goes on when Reylo sends a statement instead of being built into the module, and the docs, the declarations and the captures follow.
- Comment added at send time:
sentTextinsrc/execute.tsadds the comment last instatement(), after a structured parameter'svarianthas rewritten its lists. That covers.run(),.runSync()and a Standard Query'sencode.standard-query.ts'sstatementTextalso goes throughsentText, so the check that a statement's text doesn't depend on its input still compares a commented text with a commented text. - Module flag: the loader writes
sqlcommenter: trueintodefineQuerywhen the project has it on.QueryDefinitionandQueryModulegain the field. A query defined by hand still gets no comment, as before. .sqlisrewritten.sql.trimEnd(): the loader, the mapper andcapture-types.tsall use it. The structured lists' offsets are computed on the trimmed text, which only changes at its end, so the offsets don't move.- Declarations:
sqlandrawlose their doc comments, andsqlNoteandRAW_NOTEare gone. The mapper'sProjectandconfigIdentitydropsqlcommenter, since declarations no longer depend on it. The session key insrc/analyze.tsstill includes it, which is right because the loader still reads it. - Docs: the
.sqlsentence in Usage and thesqlcommenterparagraph in Configuration are updated. The skill never mentions the comment, so it needs no change.
claude-opus-5-5 | 𝕏
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.

The query's
.sqlis the compiled statement alone. The sqlcommenter comment naming the file is added only where Reylo sends the statement, so it still reaches the database's monitoring, but.sqland its hover no longer carry it.getUser.sqlisselect id, name, email from users where id = $1: no/*file='…'*/, and no trailing newline..run()and a Standard Query'stextsend the statement with the comment, unless the project file sayssqlcommenter: false. The module now passessqlcommenter: truetodefineQuery, andsentTextinsrc/execute.tsappends the comment last, after a structured parameter's lists are written.sqlas the compiled statement, and neithersqlnorrawcarries a doc comment, so a hover over either shows its text once. The note undersqlthat explained placeholders and casts is gone (sqlNoteandRAW_NOTEinsrc/doc-comment.ts). The import's hover still shows the file's comment and the statement as written..sqlis the compiled query with the database's own placeholders; Configuration says each query Reylo sends ends with the comment and that.sqlleaves it out.site/scripts/capture-types.tsrenders the same declaration, andsite/lib/sql-modules.jsonis captured again. Twelve MySQL modules also pick up the more detailedQueryErrorthe current engine writes, which the committed capture had not caught up with..sql's value changes, hence the!.Checks:
nub run typecheck,nub run testwith Postgres 18 and MySQL 8.4 (282 pass, none skipped),nub run build, andnub run buildinsite/.