Skip to content

Test connectivity while registering data store#290

Closed
bhargavkn wants to merge 4 commits intobalderdashy:masterfrom
bhargavkn:patch-datastore-connectivity
Closed

Test connectivity while registering data store#290
bhargavkn wants to merge 4 commits intobalderdashy:masterfrom
bhargavkn:patch-datastore-connectivity

Conversation

@bhargavkn
Copy link

@bhargavkn bhargavkn commented Jun 22, 2021

Changes in this PR attempt to resolve balderdashy/sails#7095 by Introducing and exposing a new method validateConnection that is called by waterline after a datastore is registered to check database connectivity. The method tests connectivity by attempting to acquire and release a connection to the database.

If either of (a) acquiring a connection or (b) subsequent release of connection fails, validate-connection returns an error.

The other half of the complete fix lies here: balderdashy/waterline#1621

@bhargavkn
Copy link
Author

bhargavkn commented Jun 22, 2021

@eashaw Requesting an early set of eyes on this PR to figure out if it's going in the right direction before I write tests for it 🙇‍♂️

Copy link
Member

@eashaw eashaw left a comment

Choose a reason for hiding this comment

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

Hi @bhargavkn, I've tested this and it works as expected.
Do you think you would be able to handle this by testing the connection before registerDataStore() and without making any changes register-data-store.js?

@bhargavkn
Copy link
Author

@eashaw sure, will try it out and update this PR with the changes soon.

@bhargavkn
Copy link
Author

@eashaw may I please have another round of review on this PR? 🙇

@bhargavkn bhargavkn closed this Oct 22, 2021
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.

Better error message for bad postgres config

2 participants