I have an empty Spanner database (created with Terraform) which, during creation, is creating a DDL like this:
ALTER DATABASE test SET OPTIONS (
version_retention_period = '7d'
);
When I run the diff tool, I get an error here:
Exception in thread "main" java.lang.IllegalArgumentException: Unsupported statement type: alter_database_statement
at com.google.cloud.solutions.spannerddl.diff.DdlDiff.separateTablesIndexesConstraints(DdlDiff.java:539)
at com.google.cloud.solutions.spannerddl.diff.DdlDiff.build(DdlDiff.java:483)
at com.google.cloud.solutions.spannerddl.diff.DdlDiff.main(DdlDiff.java:638)
As far as I can tell, the tool doesn't allow for a non-default version_retention_period to be set via ALTER DATABASE, as it cannot parse the ALTER DATABASE statement.
We have two potential workarounds and wanted to know your input:
Text process the input ddl to remove the ALTER DATABASE
Implement the alter_database_statement so parsing works, make it noop? Or actually support ALTER DATABASE settings.
I have an empty Spanner database (created with Terraform) which, during creation, is creating a DDL like this:
When I run the diff tool, I get an error here:
As far as I can tell, the tool doesn't allow for a non-default version_retention_period to be set via ALTER DATABASE, as it cannot parse the ALTER DATABASE statement.
We have two potential workarounds and wanted to know your input: