tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.23k stars 468 forks source link

Adding support for driver choice and col encrypt #1430

Open ctgbarcalow opened 2 years ago

ctgbarcalow commented 2 years ago

What this does:

This modification would allow Windows users to choose their own driver instead of being forced to use the Native Client 11.0. It also makes a slight modification to the default connection strings to allow for the use of encrypted columns.

Related issues:

Pre/Post merge checklist:

dhensby commented 2 years ago

Thanks for this @ctgbarcalow. Please fix the linting issues. Please can you also add some test coverage?

dhensby commented 2 years ago

So we are seeing failures in the Visual Studio 2015 builds with the error:

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Perhaps this is because the ODBC Driver 17 isn't installed on that image? Seems a bit odd that it's only happening on those images.

dhensby commented 1 year ago

I'm just reviving this, but wondering if it's needed now we have the ability for consumers just to pass the connection string directly to the driver: https://github.com/tediousjs/node-mssql/blob/v9.3.0/lib/msnodesqlv8/connection-pool.js#L19-L34

If a connection string is provided, then it is used as-is, allowing consumers to just construct the connection string they need themselves. This has actually been the case for some time.

dhensby commented 1 year ago

We are seeing the same problem as we were on AppVeyor where it appears that ODBC Driver 17 isn't installed - we can install it in our runs and see if that fixes the tests.

dhensby commented 1 year ago

OK - I can't get this passing in CI and I'm not entirely sure why. I'm also not sure this feature is even needed anymore as consumers can provide their own connection string themselves now.

@ctgbarcalow I'm really sorry this has taken a year to get to this point; do you have any interest in trying to get it to pass in CI or do you agree that the feature is now not required given my point above?

ctgbarcalow commented 1 year ago

I'm not able to connect to an SQL Server using the connectionString parameters of config and the ODBC driver. I could be doing it wrong through. I would be happy to help with trying to get it to pass CI but I couldn't find a way to edit the steps. It did look like some of the steps might be OOO.

dhensby commented 1 year ago

So you're able to get this working locally? But if you provide your own connection string it doesn't work?

To get it working in CI we need the right drivers installed, I think, the question is what are they?