Closed christianklotz closed 7 years ago
this is awesome!
Looking at the failed test I wonder if it should simply skip the test if SPANNER_DATABASE
isn't set? Currently it just skips it on tests being run with the short
flag and therefor results in the following message.
database name "" should conform to pattern "^projects/[^/]+/instances/[^/]+/databases/[^/]+$"
exit status 1
FAIL github.com/mattes/migrate/database/spanner 0.024s
Since there's no public Spanner instance nor a way to run Spanner within a Docker container I don't really see how we could test it with Travis. What do you think?
yeah, that sounds good to me. maybe we can add a comment in the readme.
Closes #172.
Implementation
Follows for most parts the guide at https://cloud.google.com/spanner/docs/getting-started/go.
The database URL must be provided in the following format.
Sample migrations based on the PostgreSQL examples are included, too. The naming convention – according to Google's sample code – seems to be PascalCasing/UpperCamelCase which has been applied to table and column names.
Testing
Google Spanner is exclusive to Google Cloud Platform and doesn't currently offer a self-hosting option. Hence, a
SPANNER_DATABASE
environment variable is expected to run the test which is also the reason why I didn't use the Docker approach for testing.