GoogleCloudPlatform / cloud-spanner-emulator

An open source emulator for Cloud Spanner.
Apache License 2.0
276 stars 45 forks source link

ALTER DATABASE ddl not supported #27

Open dmivankov opened 3 years ago

dmivankov commented 3 years ago

Docs on ALTER DATABASE https://cloud.google.com/spanner/docs/data-definition-language#alter-database Code similar to https://github.com/googleapis/java-spanner/blob/9132c21e9ea94f0e2ceea3f9ad5c4461ffa6796e/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrUpdateDatabaseTest.java

ALTER DATABASE `database_name` SET OPTIONS (version_retention_period = '1d')

produces

Unexpected statement: alter_database_statement

ALTER DATABASE statement is being low-level parsed https://github.com/GoogleCloudPlatform/cloud-spanner-emulator/blob/master/backend/schema/parser/ddl_parser.jjt#L298 but isn't handled anywhere

Would be nice to have support for those DDL statements, or at least have them listed in https://github.com/GoogleCloudPlatform/cloud-spanner-emulator/blob/master/README.md#features-and-limitations

dmivankov commented 3 years ago

Also not supported for createDatabase with extra ddl statements parameter.

cy commented 2 years ago

also running into this. would be great if the emulator supported ALTER DATABASE

gauravpurohit06 commented 1 year ago

Thanks @dmivankov for filing the request. We are tracking the enhancement with the internal development team and will get back with the timelines.

jin-jj commented 1 year ago

Also not supported for createDatabase with extra ddl statements parameter.

Do you mean create db + ddl statements not working?