Is your feature request related to a problem? Please describe.
Based on my experience looking at Spanner-related OSS projects such as spanner-cli (and its my fork, spanner-mycli), wrench, yo, and golang-migrate, I've observed that many of them don't require a full-fledged SQL parser. Instead, they typically need a subset of functionalities, specifically:
- Statement splitting that correctly handles (or isn't confused by) semicolons within comments and string literals.
- Statement type identification (often, just the first token after skipping any hints is sufficient).
- Query parameter detection (though this is less commonly required).
Describe the solution you'd like
The implementation in go-sql-spanner/statement_parser.go provides an adequate solution for this use case. Although I understand there might still be potential for breaking changes, would it be possible to export this implementation once it becomes stable?
Describe alternatives you've considered
While cloudspannerecosystem/memefish, which includes a GoogleSQL lexer/parser, could be used to implement these, an additional (or separate) implementation would be necessary if a Spanner-supporting OSS project also needs to support the PostgreSQL interface in addition to the GoogleSQL interface.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
Based on my experience looking at Spanner-related OSS projects such as
spanner-cli(and its my fork,spanner-mycli),wrench,yo, andgolang-migrate, I've observed that many of them don't require a full-fledged SQL parser. Instead, they typically need a subset of functionalities, specifically:Describe the solution you'd like
The implementation in
go-sql-spanner/statement_parser.goprovides an adequate solution for this use case. Although I understand there might still be potential for breaking changes, would it be possible to export this implementation once it becomes stable?Describe alternatives you've considered
While
cloudspannerecosystem/memefish, which includes a GoogleSQL lexer/parser, could be used to implement these, an additional (or separate) implementation would be necessary if a Spanner-supporting OSS project also needs to support the PostgreSQL interface in addition to the GoogleSQL interface.Additional context
Add any other context or screenshots about the feature request here.