Skip to content

Support for Spanner DML #135

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

Open
lc-jordanfelix opened this issue Dec 12, 2018 · 6 comments · May be fixed by #1197
Open

Support for Spanner DML #135

lc-jordanfelix opened this issue Dec 12, 2018 · 6 comments · May be fixed by #1197

Comments

@lc-jordanfelix
Copy link

Is your feature request related to a problem? Please describe.
We would like to be able to load non-transactional data using this tool.

Describe the solution you'd like
Running DML statements as well as DDL statements.

Describe alternatives you've considered
Using a separate tool. It would be much more useful for us to be able to run both DML and DDL in a migration-like manner using one tool.

Additional context
Syntax error on line 1, column 1: Encountered \'INSERT\' while parsing: ddl_statement\nSyntax error on line 1, column 1: Expecting \'EOF\' but found \'INSERT\'

Syntax error on line 1, column 1: Encountered \'UPDATE\' while parsing: ddl_statement\nSyntax error on line 1, column 1: Expecting \'EOF\' but found \'UPDATE\'

We see that these are coming from "cloud.google.com/go/spanner/admin/database/apiv1".DatabaseAdminClient.UpdateDatabaseDdl(...) in migrate/database/spanner/spanner.go and that there may not be support for DML in the same google library, but we hope you might have a solution.

Thanks!

@lc-jordanfelix
Copy link
Author

For anyone interested in this as well, we currently are using this script as an alternative for our Spanner DML files. You can find it in our public repo.

We are improving it as we go.

@juztin
Copy link

juztin commented Jun 10, 2021

Oh man, just stumbled across this after getting everything all integrated and working within a pipeline.
Is it possible to add an asterisk to "Spanner" within the README, stating that it's only partially supported?
Not being able to run dml statements is kind of a big deal.

@dhui
Copy link
Member

dhui commented Jun 11, 2021

If anyone would like to add DML support for spanner, I'd be happy to review it.

The PR would need to have tests and be backwards compatible. e.g. shouldn't break existing users of the migrate spanner db driver

@jorygeerts
Copy link

@dhui Would an approach where each migration file may contain either DDL or DML but not both be acceptable?

If yes, what approach of detecting which a given migration file contains would you prefer, parsing the contents, or adding some kind of "marker" to the filename in case of DML (not required for DDL, to keep things backwards compatible)? Or something else I haven't thought of. :)

@plemanach
Copy link

Hi @dhui,
I created this PR that add DML for spanner, let me know your thoughts.
Thanks,
Patrice

@afarbos
Copy link

afarbos commented May 6, 2023

I /fresh created a new PR that can be merged following all your guidelines @dhui, all lines added are tested and it's fully backward compatible with no change from the user pov.

@jtwatson jtwatson linked a pull request Nov 29, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

6 participants