Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 5dcc0d51
authored
Apr 27, 2020
by
Tony Brix
Committed by
GitHub
Apr 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(mssql): tedious v9 requires connect call (#12182)
1 parent
f1e451e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
lib/dialects/mssql/connection-manager.js
test/unit/dialects/mssql/connection-manager.test.js
lib/dialects/mssql/connection-manager.js
View file @
5dcc0d5
...
...
@@ -61,6 +61,9 @@ class ConnectionManager extends AbstractConnectionManager {
try
{
return
await
new
Promise
((
resolve
,
reject
)
=>
{
const
connection
=
new
this
.
lib
.
Connection
(
connectionConfig
);
if
(
connection
.
state
===
connection
.
STATE
.
INITIALIZED
)
{
connection
.
connect
();
}
connection
.
queue
=
new
AsyncQueue
();
connection
.
lib
=
this
.
lib
;
...
...
test/unit/dialects/mssql/connection-manager.test.js
View file @
5dcc0d5
...
...
@@ -39,6 +39,8 @@ if (dialect === 'mssql') {
it
(
'connectionManager._connect() does not delete `domain` from config.dialectOptions'
,
function
()
{
this
.
connectionStub
.
returns
({
STATE
:
{},
state
:
''
,
once
(
event
,
cb
)
{
if
(
event
===
'connect'
)
{
setTimeout
(()
=>
{
...
...
@@ -58,6 +60,8 @@ if (dialect === 'mssql') {
it
(
'connectionManager._connect() should reject if end was called and connect was not'
,
function
()
{
this
.
connectionStub
.
returns
({
STATE
:
{},
state
:
''
,
once
(
event
,
cb
)
{
if
(
event
===
'end'
)
{
setTimeout
(()
=>
{
...
...
@@ -75,5 +79,29 @@ if (dialect === 'mssql') {
expect
(
err
.
parent
.
message
).
to
.
equal
(
'Connection was closed by remote server'
);
});
});
it
(
'connectionManager._connect() should call connect if state is initialized'
,
function
()
{
const
connectStub
=
sinon
.
stub
();
const
INITIALIZED
=
{
name
:
'INITIALIZED'
};
this
.
connectionStub
.
returns
({
STATE
:
{
INITIALIZED
},
state
:
INITIALIZED
,
connect
:
connectStub
,
once
(
event
,
cb
)
{
if
(
event
===
'connect'
)
{
setTimeout
(()
=>
{
cb
();
},
500
);
}
},
removeListener
:
()
=>
{},
on
:
()
=>
{}
});
return
this
.
instance
.
dialect
.
connectionManager
.
_connect
(
this
.
config
)
.
then
(()
=>
{
expect
(
connectStub
.
called
).
to
.
equal
(
true
);
});
});
});
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment