Repository navigation
fix(formatter,transform): complete lower-case output, keep comments by GO, handle TOP/FETCH - #870
Conversation
…y GO, handle TOP/FETCH - format --no-uppercase (KeywordLower) lower-cases every keyword, operator word and data type, not only clause keywords; identifiers, quoted names and literals are untouched. Rendering stays linear in expression depth. Raw JSON_TABLE/XMLTABLE clause text keeps its source case (documented). - Comments in CRLF input no longer keep '\r'. - Comments before or after a GO line stay on that side of it. - STRAIGHT_JOIN ... ON a = b, t3 no longer renders a space before ','. - transform.AddTableAlias renames qualifiers in SELECT, scope-aware. - SetLimit/SetOffset/RemoveLimit/RemoveOffset handle SQL Server TOP and FETCH FIRST/NEXT; PERCENT and WITH TIES are rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ajitpratap0's task in 26s —— View job Review of PR #870I read the Looks good
Points to consider
Tests
I found no security concerns. The changes are pure AST and text transforms. |
The 4x/10x check failed on CI: Windows timed the small case at 0s and a race run measured 12x on a 10ms sample. Locally every shape grows 15-22x for 16x more input; quadratic growth would be ~256x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 21s —— View job Review of PR #870I read Looks good
Points to consider
I found no security concerns. The changes are AST and text transforms only. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 21s —— View job Review of PR #870I read the lower-case renderer ( Looks good
Points to consider
I found no security concerns. The changes are AST and text transforms only. |
Summary
Follow-ups from the pre-merge review of #866–#868:
format --no-uppercase(KeywordCase: KeywordLower) now lower-cases every keyword. Before,AND,IN,IS NULL,DESC,CASE,BETWEEN, data types and others stayed upper case. Identifiers, quoted names and literals are untouched. Rendering is linear in expression depth: 32,000 chained terms take 0.09 s. RawJSON_TABLE/XMLTABLEclause text keeps its source case, as documented in the flag help and the CHANGELOG.\rinto\noutput.;, comments before or after aGOline stay on that side of it.STRAIGHT_JOIN … ON a = b, t3no longer renders a space before the comma.transform.AddTableAliasrenames qualifiers in SELECT, scope-aware like the UPDATE/DELETE path:FROM users WHERE users.id = 1becomesFROM users u WHERE u.id = 1.SetLimit/SetOffset/RemoveLimit/RemoveOffsethandle SQL ServerTOPandFETCH FIRST/NEXT. They no longer emitLIMITalongsideTOPorFETCH.PERCENTandWITH TIESare rejected with an error rather than guessed at.Test Plan
gofmt,go vet,golangci-lint run(0 issues),task test:race,task test:cbindingSTRAIGHT_JOINspacing, SELECT alias qualifiers, TOP/FETCH paginationBreaking Changes
format --no-uppercaseoutput changes: it is now fully lower case.SetLimiton aTOPorFETCHquery now edits that clause instead of addingLIMIT. WithPERCENTorWITH TIESit returns an error.🤖 Generated with Claude Code
https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2