Repository navigation
Conversation
Owner
Author
|
Closed while restoring #30 to its original unstacked form. |
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.
Query execution lived in the command package. It coordinated two producers through buffered channels. It could exit the process on a parse error. It did not own worker completion consistently.
This extracts
ExecuteQueryinto the library. It streams selected rows through a callback. The command remains responsible for CSV output and flushing. The executor owns the active lexer worker. It stops that worker and waits before returning.The executor accepts the query limit data model. User-query LIMIT syntax remains in the stacked PR.
The data-section lexer now uses a 64-token queue. Read, parse, callback, and CSV flush errors return to the caller. The row parser has a synchronous callback path. This keeps the Pike-style state functions while reducing retained work for small results.
Tests cover scanning, indexing, execution across INSERT blocks, offsets, zero limits, and output errors. The benchmark constructs queries directly so it measures execution without user-query parsing.
Validation:
go test ./... -timeout 30sgo test -race ./... -timeout 60sgo build ./...go vet ./...go test ./cmd/sqlread -run '^$' -bench '^BenchmarkExecQuery$' -benchmem -benchtime=200ms -count=1