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

FIX Repeat calls to mssql.connect() will only resolve when the pool is connected #986

Merged
merged 2 commits into from
Jan 31, 2020

Conversation

dhensby
Copy link
Collaborator

@dhensby dhensby commented Jan 30, 2020

This is an improvement on #804

Since the previous PR repeated calls to mssql.connect() would resolve instantly even if the pool wasn't yet in a connected state. eg:

const pool = mssql.connect().then(() => console.log('first'));
const pool2 = mssql.connect().then(() => console.log('second'));

// output:
// second
// first

This has lead to many issues where developers are not taking into account that they shouldn't be relying on being able to call connect() repeatedly.

This will improve developer experience as they will need to think less about managing the state of their global connection

todo:

  • tests

@dhensby
Copy link
Collaborator Author

dhensby commented Jan 30, 2020

NB: This code can be greatly simplified once #941 is completed

@dhensby dhensby force-pushed the pull/repeat-calls-global-connect branch 4 times, most recently from 6891f6b to 5572a43 Compare January 31, 2020 07:41
@dhensby dhensby force-pushed the pull/repeat-calls-global-connect branch from 5572a43 to 0b91d61 Compare January 31, 2020 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants