Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spanner support as an SQL output #122

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

rvilim
Copy link

@rvilim rvilim commented Sep 26, 2024

This adds Google Cloud Spanner (https://cloud.google.com/spanner?hl=en) support for sql_raw and sql_insert.

Since spanner conforms to the standards sql library this is mostly just an import. Quoting in spanner sql is slightly different than normal sql (it doesn't like double quotes) so some conditional logic had to be added, particularly in the integration tests.

The integration tests are done in the same fashion as all the other ones, with a docker container that runs the spanner emulator (dockerfile + startup script included here)

Bigger change

One bigger thing is that I've removed all the references to db.close(). In the spanner emulator this causes the emulator to actually shut down the connectionand not be able to be reused.

Reading the go docs, it seems like we really shouldn't be doing this anyways (https://pkg.go.dev/database/sql#Open) but I'm open to being wrong about this. We'd likely need to restart the spanner emulator docker container for each test.

My interpretation is that if we shouldn't be manually running close anyways then its simpler just to not run close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant