Skip to content

feat: add dialect for spanner using pg adapter#900

Open
matdurand wants to merge 1 commit intopressly:mainfrom
matdurand:feat/support-google-spanner-pg-adapter
Open

feat: add dialect for spanner using pg adapter#900
matdurand wants to merge 1 commit intopressly:mainfrom
matdurand:feat/support-google-spanner-pg-adapter

Conversation

@matdurand
Copy link

Adding support for Google Spanner but only when using their PGAdapter, which uses postgres drivers to talk to Spanner.

@@ -0,0 +1,9 @@
//go:build !no_spannerpg
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about this file, since Spanner PG would use the regular Postgres PGX driver, so should we just use "no_postgres" for both postgres and spanner?

goose vertica "vertica://user:password@localhost:5433/dbname?connection_load_balance=1" status
goose ydb "grpcs://localhost:2135/local?go_query_mode=scripting&go_fake_tx=scripting&go_query_bind=declare,numeric" status
goose starrocks "user:password@/dbname?parseTime=true&interpolateParams=true" status
goose spannerpg "user=postgres dbname=postgres sslmode=disable" status
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assume the PGAdapter is running locally on the default postgres port.

@@ -0,0 +1,44 @@
package dialectquery
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spanner via PGAdapter only has partial support for current_schema, and we can only query it directly via select current_schema but not in a where clause. For this reason, I removed the Exists to use the fallback method like the mssql dialect does.

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