mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 14:56:01 +00:00
fix: #340, SQL Server tedious driver connect to named instance
This commit is contained in:
@@ -66,14 +66,16 @@ async function tediousConnect(storedConnection) {
|
||||
const authentication = await getAuthentication(storedConnection);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const [host, instance] = server.split('\\');
|
||||
const connectionOptions = {
|
||||
instanceName: instance,
|
||||
encrypt: !!ssl || authType == 'msentra' || authType == 'azureManagedIdentity',
|
||||
cryptoCredentialsDetails: ssl ? _.pick(ssl, ['ca', 'cert', 'key']) : undefined,
|
||||
trustServerCertificate: ssl ? (!ssl.ca && !ssl.cert && !ssl.key ? true : ssl.rejectUnauthorized) : undefined,
|
||||
enableArithAbort: true,
|
||||
validateBulkLoadParameters: false,
|
||||
requestTimeout: 1000 * 3600,
|
||||
port: port ? parseInt(port) : undefined,
|
||||
port: port && !instance ? parseInt(port) : undefined,
|
||||
trustServerCertificate: !!trustServerCertificate,
|
||||
appName: 'DbGate',
|
||||
};
|
||||
@@ -83,7 +85,7 @@ async function tediousConnect(storedConnection) {
|
||||
}
|
||||
|
||||
const connection = new tedious.Connection({
|
||||
server,
|
||||
server: host,
|
||||
authentication,
|
||||
options: connectionOptions,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user