dbmate icon indicating copy to clipboard operation
dbmate copied to clipboard

Google Cloud Spanner support

Open amacneil opened this issue 5 years ago • 2 comments

Need to add support for Google Cloud Spanner

amacneil avatar May 21 '19 02:05 amacneil

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? In particular clarification about how you view Connection lifecycles would be really helpful?

AJCStriker avatar Jan 25 '21 19:01 AJCStriker

Last time I looked into this, I ran into the issue that dbmate has been designed around an assumption that all drivers will use database/sql, and the spanner driver did not use that. So it would require refactoring the driver interface to remove dependence on database/sql.

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.

amacneil avatar Jan 25 '21 19:01 amacneil