Skip to content

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

Merged
rahul2393 merged 6 commits intogoogleapis:mainfrom
110y:spansql-parse-dml-file
Jul 23, 2022
Merged

feat(spanner/spansql): support for parsing a DML file#6349
rahul2393 merged 6 commits intogoogleapis:mainfrom
110y:spansql-parse-dml-file

Conversation

@110y
Copy link
Copy Markdown
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 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
}{
{`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
Copy Markdown
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
Copy Markdown
Contributor

zchee commented Jul 20, 2022

@rahul2393 How about this PR review progress?

@rahul2393
Copy link
Copy Markdown
Contributor

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

@zchee
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

4 participants