Closed isaru66 closed 6 months ago
If you see line 14-17 of the file you've updated. All the options passed are added to cfg.options
, so this change is redundant and I do not believe is the cause of the problem.
As pointed out in the issue, there is no extras
prop supported.
Can you confirm you've actually run this locally and it works Vs the current stable release, because I can't see how this makes a difference nor magically jumps a prop from extras to options.
From your reply in the linked issue, I am further convinced this will not "work" and, as pointed out, this is a redundant change as the props are already present.
@dhensby
I have confirm that I have run this locally, and we need the proposed code change to pass multiSubnetFailover
option to tediousjs driver.
From TypeORM, node-mssql was created via mssql.ConnectionPool(connectionOptions)
I have debug the code locally, if the current code worked, At line 39 multiSubnetFailover
should be already in cfg.options
already, but it doesn't.
Another things is, as trustServerCertificate
and multiSubnetFailover
is configured at the same level. We can see that trustServerCertificate
also required to be explicitely defined in order to be passed down to tedious driver at line16 as well.
I also test this code in our customers environment and confirm that once we added the code fix, the tedius driver now use parallel connection strategy on the actual Microsoft SQL server that configure multi-subnet Always on avalibility group.
Currently we need to fork node-mssql and applied patch in another repo, but I think it would be good if the fix get merged up to node-mssql directly. If the code styling is not good - I can change based on your comments.
What this does:
This PR allow option
multiSubnetFailover
to be passed from typeorm -> node-mssql -> tedious driver.This option allow support for MSSQL alway on avalibility group that primary site and secondary site using IP in difference subnet. ref: https://learn.microsoft.com/en-us/sql/sql-server/failover-clusters/windows/sql-server-multi-subnet-clustering-sql-server?view=sql-server-ver16#DNS in tediousjs this feature was implemented in https://github.com/tediousjs/tedious/pull/362
with current version of TypeORM (0.3.20), multiSubnetFailover option can be passed in extra section as below.
however, without this PR. TypeORM pass multiSubnetFailover config option to Node-MSSQL, however Node-MSSQL will never be passed this option to TediousJS.
Related issues:
https://github.com/tediousjs/node-mssql/issues/1619
Pre/Post merge checklist: