Google Cloud Spanner support #369
Replies: 3 comments 3 replies
-
Hey @amacneil I would be interested in picking this issue up and submitting a PR. I took a look at the current drivers but is there anything to keep in mind whilst designing an integration? |
Beta Was this translation helpful? Give feedback.
-
Last time I looked into this, I ran into the issue that dbmate has been designed around an assumption that all drivers will use Long term I think this is a good direction to take dbmate, but just be aware that to achieve this feature I think you will need to refactor the interface and all other drivers to match the new interface, it won't be a simple case of adding one new driver. From memory there also might be a problem with the spanner driver not accepting multiple sql statements in one string, so we will need to import a sql parsing library and do our own statement splitting. Again I think this is a nice feature that would benefit all drivers eventually (allowing us to give more helpful error messages, etc), but it adds complexity. |
Beta Was this translation helpful? Give feedback.
-
Spanner has two supported dialects at the moment: GoogleSQL and Postgres, the latter with some limitations and a smaller subset of supported functions. The dialect for a database is chosen at database creation, and can't be changed - so full-featured support would require separate support for both. Supporting GoogleSQL would probably mean a new driver that uses https://github.com/googleapis/go-sql-spanner, and the queries would be different from the Postgres driver. Supporting the Postgres interface through the PGAdapter should be relatively simple:
|
Beta Was this translation helpful? Give feedback.
-
Need to add support for Google Cloud Spanner
Beta Was this translation helpful? Give feedback.
All reactions