go-cloud icon indicating copy to clipboard operation
go-cloud copied to clipboard

postgres/gcppostgres: add support for AlloyDB

Open jinlinux opened this issue 2 years ago • 3 comments

Are there plans to add support for connecting to the Postgres compatible AlloyDB in GCP?

jinlinux avatar Apr 05 '23 01:04 jinlinux

No concrete plans, no. Happy to take pull requests. What does a sample sql.OpenDB look like?

vangent avatar Apr 05 '23 01:04 vangent

In their go connector example shows something like this.

    db, err := sql.Open(
        "alloydb",
        "host=projects/<PROJECT>/locations/<REGION>/clusters/<CLUSTER>/instances/<INSTANCE> user=myuser password=mypass dbname=mydb sslmode=disable",
	)

jinlinux avatar Apr 05 '23 02:04 jinlinux

Happy to take a PR on this. I think you should be able to start with https://github.com/google/go-cloud/blob/master/postgres/gcppostgres/gcppostgres.go and modify it for the above.

vangent avatar Apr 06 '23 23:04 vangent