node-postgres
node-postgres copied to clipboard
Return the client instance in the `connect()` method
Note: I open this PR as a conversation starter, I've explained my reasoning in a Redis Issue here. I'd be happy to open an issue instead, but I thought showing the code would be faster/easier.
I'd like to suggest returning the client instance in the .connect() method, so that we can create a client in a single step:
const client = await new Client().connect();
If this change is welcome, I'd be happy to add more things to this PR like testing, documentation, etc.