-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Comments
I was working on this issue when I noticed your proposal. This issue came up again when I tried to use the I agree that full syntax parsing is overkill and is like playing whack-a-mole with spanner features. Forever chasing them and often lagging behind. This is ultimately why I think we need the following features for more robust migration support for Spanner:
I was planning to implement the following:
The |
Good!
Actually, I have done similar thing to migrate another OSS, wrench. It needs all of 1, 2, 3, 4 so I have implemented some helper functions using |
I have a question regarding backward compatibility. Looking for opinions. The current state without
The current state with
I am considering changing the default action to always parse the migration scripts since this is required for DML. There is a narrow use case where retaining the ability to process migration scripts in their raw format would prevent a backward compatibility issue if the We have the following options:
In my opinion, the current functionality with But potentially causing a backward compatibility issue with no way to disable the new functionality isn't very good either. I am leaning towards 3. above, with the acknowledgment that this could break some existing code, but the break could be rolled back with a config change. This would also provide a better user experience for new users. Thoughts? |
It is a golang-migrate design issue and I would be not a right person to answer it, but I agree FYI: As far as I know, memefish lexer won't fail to tokenize all current-valid GoogleSQL queries because it knows all tokens of ZetaSQL(GoogleSQL frontend). |
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.
migrate/database/spanner/spanner.go
Lines 343 to 347 in c378583
I think it can be implemented without full syntax parsing using only a lexer.
The text was updated successfully, but these errors were encountered: