Skip to content

Added isConnected method to Connection.js #2341

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

Closed
wants to merge 1 commit into from

Conversation

anasabdullahysfzai
Copy link

I have added isConnected() method to Connection.js . Now its easy to check whether you are connected to database or not.

Copy link
Member

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this, but based on the PR, how is this different from just writing connection.state === 'connected' ?

@anasabdullahysfzai
Copy link
Author

anasabdullahysfzai commented Apr 24, 2020

I have worked on diverse tools for development (PHP,Java,C#) and isConnected() method is a common perception in db drivers to be used for check whether the connection is still connected. I was working on some other project today and found it missing so i added

@dougwilson
Copy link
Member

Thank you, that is very appreciated. I appreciate that other tools have differing APIs, and acknowledge that each project can have it's own opinion as to what type of API it should present to the user.

@dougwilson dougwilson closed this Apr 24, 2020
@anasabdullahysfzai
Copy link
Author

Sure , thank you for your time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants