Fix CLI bugs: DML classification, trace timeout, partition timestamp#65
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces regex-based DML detection with a custom SQL classifier (isDML) that strips leading comments and whitespace, updates Go version requirements to 1.25, refactors telemetry shutdown logic to prevent fatal crashes, and updates batch transaction options. Feedback points out that strings.Cut(rest, " ") fails to isolate the keyword if it is followed by other whitespace characters like newlines or tabs, and suggests using strings.IndexAny along with adding corresponding test cases.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Replace hand-rolled DML detection with gsqlutils/stmtkind.IsDMLLexical and drop gsqlsep in favor of memefish.SplitRawStatements for emulator fixtures. Keeps trace timeout, partition timestamp bound, and Go 1.25 fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the project to Go 1.25, replaces regex-based DML detection with stmtkind.IsDMLLexical from gsqlutils, refactors telemetry shutdown handling, and updates the batch transaction initialization. It also adds a new context deadline test and migrates integration tests to use memefish for statement splitting. Feedback on the changes suggests removing the unused sqlclassify.go and sqlclassify_test.go files, and deferring bt.Cleanup(ctx) to prevent potential resource leaks during batch read-only transactions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Delete unused local DML classifier superseded by stmtkind.IsDMLLexical. Ensure BatchReadOnlyTransaction.Cleanup runs on PartitionQuery errors. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
gsqlutils/stmtkind.IsDMLLexical(memefish lexer + hint-aware first token) instead of regex/hand-rolled comment stripping.--timeoutwhen--experimental-trace-projectis set; log trace shutdown errors instead oflog.Fatal.--try-partition-query.ko.ymltogo-version-file: go.mod.gsqlsep; integration tests split DDL/DML withmemefish.SplitRawStatements.Rationale
Consolidate on memefish lexer-based utilities for statement classification and splitting rather than maintaining parallel ad-hoc parsers.
Test plan
go test ./...TestWithCancelPreservesParentDeadlinedocuments trace context wiringFixes #57, #58, #60, #61