Does knex support Windows Authentication for MS SQL?
See original GitHub issueI’m trying to connect to MS Sql using a config that looks like:
{
client: "mssql",
connection: `Server=0.0.0.0,1433;Database=MyApp;User Id=MyApp;Password=my_password`,
}
But am receiving the error:
The "config.server" property is required and must be of type string.
It looks like the connection string is getting parsed into:
{
"client": "sqlite3",
"connection": {
"filename": "Server=0.0.0.0,1433;Database=MyApp;User Id=MyApp;Password=my_password"
}
}
Does knex support an MS SQL connection string? Based on the error I’m receiving and this issue my sense is that the answer is no, but I wanted to be certain.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How to connect to SQL Server with Windows authentication ...
knex uses mssql which in turn uses either tedious or msnodesqlv8 . tedious doesn't support Windows Authentication. The default is tedious .
Read more >Connecting To Microsoft SQL Server From Node.js Using ...
Connecting To Microsoft SQL Server From Node.js Using Windows Authentication. I usually use Knex.js to connect to databases from Node.js ...
Read more >Authenticate User from SQL Server with Nodejs, Promises and ...
This videos demonstrates as to how we can authenticate user credentials from SQL Server with the help of Nodejs, Promises and Knex Library....
Read more >Connecting Nodejs with MS SQL Server through Knex npm ...
This videos demonstrates how to connect Nodejs with MS SQL Server with Knex npm package. It explains how to pass on the configuration ......
Read more >Overriding Knex tedious driver with msnodesqlv8 : r/node
Does anyone know how to override tedious? We use Windows authentication to connect to our sql server, unfortunately, this isn't possible ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Maybe this page might interest some of you: https://www.connectionstrings.com/sql-server-2016/
Edit: I looked a bit further into this. What I don’t understand is, that you guys say that you snippets work. Currently, knex.js uses the tedious driver hard-coded.
I do know, how to create a connection with the nodedesqlv8 driver (see below) but I don’t have any idea on how to force knex to use that driver. (I would be willing to change the knex implementation, even on a fork if I have to)
I was able to connect using msnodeqlv8 by making a new dialect based on this example
I just added the msnodesqlv8 module and used the following code, hopefully it helps someone out: