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

Publicly expose the driver so it can be wrapped #166

Merged
merged 2 commits into from
Nov 9, 2018

Conversation

luna-duclos
Copy link

This lets tools such as https://github.com/luna-duclos/instrumentedsql wrap the driver and provide instrumentation.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@luna-duclos
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@Carrotman42
Copy link
Contributor

Carrotman42 commented May 21, 2018

IMO it would be better if github.com/lib/pq were updated to allow custom dialers. Then this package wouldn't have to register a new driver just to allow a custom dialer, and this specialized logic could be made to look more like mysql/hook.go.

(although since we've already released a version where we register a database driver called cloudsqlpostgres we may be stuck supporting this thing forever anyway... so maybe this PR is just fine)

@kurtisvg kurtisvg added Status: Proposal type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jul 16, 2018
@luna-duclos
Copy link
Author

Any update on this ?

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@googlebot
Copy link

CLAs look good, thanks!

@broady
Copy link
Contributor

broady commented Oct 24, 2018

Hey Luna,

I messaged you on the Gopher slack about this PR. Maybe we can chat there in realtime (probably tomorrow, since I think it's late where you are...)

it would be better if github.com/lib/pq were updated to allow custom dialers.

It doesn't seem to have gotten much traction:
lib/pq#470

Is there any reason not to expose this Driver except that it'd be better to do it a different way in lib/pq (if they'd even make that change)?

@Carrotman42
Copy link
Contributor

Is there any reason not to expose this Driver except that it'd be better to do it a different way in lib/pq (if they'd even make that change)?

That's my concern I suppose. I was trying to avoid the need to maintain it here. But if people want it and the other repo refuses to maintain it for us, I suppose we could exert the effort to make it better for our consumers.

@Carrotman42
Copy link
Contributor

That, plus the database/SQL driver namespace is global, and I don't like adding to the global namespace of possible drivers if we don't have to. I'd rather piggyback off someone else's name to avoid collisions.

@broady
Copy link
Contributor

broady commented Nov 7, 2018

@Carrotman42 any further objection?

Let's get this merged, if not. I think it's fair to say that adding support custom dialer registration to lib/pq is a long shot.

@Carrotman42
Copy link
Contributor

Yeah just go ahead - I don't need to be a stick in the mud here for no great reason.

@hfwang
Copy link
Contributor

hfwang commented Nov 9, 2018

Thanks for your patience Luna!

@hfwang hfwang merged commit e570627 into GoogleCloudPlatform:master Nov 9, 2018
yosatak pushed a commit to yosatak/cloud-sql-proxy that referenced this pull request Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants