Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Migrate parser library in Spanner support from spansql to memefish #1194

Open
apstndb opened this issue Nov 12, 2024 · 0 comments
Open

Comments

@apstndb
Copy link

apstndb commented Nov 12, 2024

Is your feature request related to a problem? Please describe.

It seems that spansql package which is used in Spanner support is not actively developed.
googleapis/google-cloud-go#11115

Many of the issues opened due to spansql's lack of support for Spanner SQL syntax.

(Although I think some issues are already resolved in latest spansql.)

Describe the solution you'd like

Migrating to another Spanner SQL parser implementation is a solution.
I recommend to consider cloudspannerecosystem/memefish.
Whose Spanner SQL coverage is already superset of spansql.

Describe alternatives you've considered

Current usage of spansql is only splitting DDL statements and strip comments.

func cleanStatements(migration []byte) ([]string, error) {
// The Spanner GCP backend does not yet support comments for the UpdateDatabaseDdl RPC
// (see https://issuetracker.google.com/issues/159730604) we use
// spansql to parse the DDL and output valid stamements without comments
ddl, err := spansql.ParseDDL("", string(migration))

I think it can be implemented without full syntax parsing using only a lexer.

@apstndb apstndb changed the title Proposal: Migrate parser library in Spanner from spansql to memefish Proposal: Migrate parser library in Spanner support from spansql to memefish Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant