Repository navigation
Conversation
Creating a PostgreSQL-dialect Spanner database sets DatabaseDialect.POSTGRESQL on CreateDatabaseRequest before applying PostgreSQL DDL via UpdateDatabaseDdlRequest. Add spanner_postgresql_create_database.
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new script and corresponding tests to create a PostgreSQL-dialect Spanner database with initial DDL schemas for 'Singers' and 'Albums' tables. The implementation includes error handling for existing databases and API call failures, as well as a CLI entry point. Unit and live integration tests are also provided to verify the database creation functionality. No review comments were provided, so there is no additional feedback.
…abase Problem: the sample waits on a long-running operation with a client-side timeout. When that wait expires the client raises TimeoutError, which is not an API call error, so the sample ended with an unhandled traceback. Solution: catch TimeoutError and print a clear message to stderr noting that only the wait timed out and the operation may still be running (the timeout does not cancel it). Add a unit test covering the new handler.
…tabase Problem: multi-line SQL and DDL statements were written as adjacent string fragments. That style is easy to get wrong (a missing trailing space joins two SQL tokens) and is harder to read than the statement itself, and the samples in this set mixed it with triple-quoted SQL. Solution: write each multi-line statement as a single triple-quoted string, matching the layout already used by the other samples. Only whitespace between SQL tokens changes; the statements are otherwise identical. Files updated: - spanner/postgresql/src/spanner_postgresql/postgresql_create_database.py
Description
Adds
spanner_postgresql_create_databasecreating aPOSTGRESQL-dialect Spanner database and initialSingersandAlbumstables.Checklist
Testing
Compliance & Style
spanner/, which the default repository owners cover.Post-Approval Actions