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

feat(spanner/spansql): support for parsing a DML file #6349

Merged
merged 6 commits into from
Jul 23, 2022

Conversation

110y
Copy link
Contributor

@110y 110y commented Jul 17, 2022

  • Add spansql.ParseDML corresponding to existing ParseDDL in order to support for parsing a DML file.

Background

As I am a maintainer of the cloudspannerecosystem/wrench, which is a schema migration tool for Spanner, I'm planning to use spansql in order to replace the current regex-based parsing. wrench supports executing the multiple DMLs in a file, so I'd like spansql to have the ParseDML function same as the ParseDDL function.

Note

This PR does not add support for Position of DMLs. It should be added as another PR.

@110y 110y requested review from a team as code owners July 17, 2022 14:04
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: spanner Issues related to the Spanner API. labels Jul 17, 2022
@@ -32,7 +32,8 @@ func TestParseQuery(t *testing.T) {
want Query
}{
{`SELECT 17`, Query{Select: Select{List: []Expr{IntegerLiteral(17)}}}},
{`SELECT Alias AS aka From Characters WHERE Age < @ageLimit AND Alias IS NOT NULL ORDER BY Age DESC LIMIT @limit OFFSET 3` + "\n\t",
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These formatting changes were made by gopls with its gofumpt option.

@rahul2393 rahul2393 added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Jul 19, 2022
@zchee
Copy link

zchee commented Jul 20, 2022

@rahul2393 How about this PR review progress?

@rahul2393
Copy link
Contributor

Hello, @zchee this PR will be released in next release, review is in progress.

@zchee
Copy link

zchee commented Jul 20, 2022

@rahul2393 Thanks! can't wait to this feature :D

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 20, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 20, 2022
@110y
Copy link
Contributor Author

110y commented Jul 20, 2022

The build was failed due to spanner/spansql/parser.go:79:1: exported function ParseDML should have comment or be unexported.
So, I just added comments to the ParseDML function.

@rahul2393 Could you please check and rerun the build?

@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 20, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 20, 2022
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 23, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 23, 2022
@rahul2393 rahul2393 merged commit 267a9bb into googleapis:main Jul 23, 2022
@110y 110y deleted the spansql-parse-dml-file branch July 24, 2022 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. priority: p3 Desirable enhancement or fix. May not be included in next release. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants