GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — Return the client instance in the `connect()` method by franciscop · Pull Request #3564 · brianc/node-postgres Conversation
|
|
yeah that's a nice little API QOL improvement! Tests & docs & we're good to merge! Sorry for the delay! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! I'll try to get it done over the weekend! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
awesome! no rush...it's all appreciated. ❤️ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think it's ready! I replaced the main docs bit for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @franciscop! One thing: can you change the native client as well to do the same behavior? The tests are currently failing now due to the difference. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks, fixed it. A couple of things I noticed:
suite.test('valid connection completes promise', () => { const client = new pg.Client() return client.connect().then(() => { return client.end().then(() => {}) }) })
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think for the pricipal of least surprise, it would probably be better to pass it to the callback. But yeah...I don't think its common to use the callback APIs anymore. I'm considering removing them in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Now that I have a better look, it seems in fact that this._connectionCallback(null, this) But the native client was not, fixed it: - cb() + cb(null, this)
I hear you, in my bubble it seems like long ago that people used callbacks instead of promises, but I've never maintained such a popular project like this so I don't know about the people using it too well. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey thanks so much for the PR! Will release it soon. :) ❤️ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.