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

How to register a bind type for a new driver? #390

Closed
cmoad opened this issue Feb 24, 2018 · 2 comments
Closed

How to register a bind type for a new driver? #390

cmoad opened this issue Feb 24, 2018 · 2 comments

Comments

@cmoad
Copy link
Contributor

cmoad commented Feb 24, 2018

In trying to integrate the "cloudsqlpostgres" driver, I don't see a way to specify the bind type as DOLLAR at setup time. I don't want to be forced to add code to manually rebind using sqlx.Rebind throughout my project which has hundreds of queries. Also, for some environments we use the "postgres" driver directly and I'm hoping to seamlessly switch between the two drivers.

Option 1: Add "cloudsqlpostgres" to the BindType function.
Option 2: Expose a way to manually set the bind type when setting up the connection.
Option 3: ???

Thanks for an awesome library.

ref: https://github.com/GoogleCloudPlatform/cloudsql-proxy/blob/master/proxy/dialers/postgres/hook_test.go
ref: https://github.com/jmoiron/sqlx/blob/master/bind.go#L22

@cmoad
Copy link
Contributor Author

cmoad commented Feb 24, 2018

Created #391 in case Option 1 is acceptable for the maintainers.

@jmoiron
Copy link
Owner

jmoiron commented Feb 28, 2018

An alternate to Option 1 would be nice at some point. I think I'm going to wait for the versioning situation to settle before having backwards-incompatible fixes to some of the warts related to global registration et al, and this is one of them.

#391 merged, thanks :)

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

No branches or pull requests

2 participants