mirror of
https://github.com/dbgate/dbgate
synced 2024-11-21 23:39:46 +00:00
mssql tedious fix #236
This commit is contained in:
parent
50f9b9f025
commit
bfea77c56b
@ -5,6 +5,7 @@ services:
|
|||||||
dbgate:
|
dbgate:
|
||||||
build: docker
|
build: docker
|
||||||
# image: dbgate/dbgate:beta-alpine
|
# image: dbgate/dbgate:beta-alpine
|
||||||
|
# image: dbgate/dbgate:beta
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 3100:3000
|
- 3100:3000
|
||||||
@ -17,6 +18,13 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
WEB_ROOT: /dbgate
|
WEB_ROOT: /dbgate
|
||||||
|
|
||||||
|
# CONNECTIONS: mssql
|
||||||
|
# LABEL_mssql: MS Sql
|
||||||
|
# SERVER_mssql: mssql
|
||||||
|
# USER_mssql: sa
|
||||||
|
# PORT_mssql: 1433
|
||||||
|
# PASSWORD_mssql: Pwd2020Db
|
||||||
|
# ENGINE_mssql: mssql@dbgate-plugin-mssql
|
||||||
proxy:
|
proxy:
|
||||||
# image: nginx
|
# image: nginx
|
||||||
build: test/nginx
|
build: test/nginx
|
||||||
@ -32,6 +40,14 @@ services:
|
|||||||
# FILE_sqlite: /mnt/sqt/Chinook.db
|
# FILE_sqlite: /mnt/sqt/Chinook.db
|
||||||
# ENGINE_sqlite: sqlite@dbgate-plugin-sqlite
|
# ENGINE_sqlite: sqlite@dbgate-plugin-sqlite
|
||||||
|
|
||||||
|
# mssql:
|
||||||
|
# image: mcr.microsoft.com/mssql/server
|
||||||
|
# restart: always
|
||||||
|
# environment:
|
||||||
|
# - ACCEPT_EULA=Y
|
||||||
|
# - SA_PASSWORD=Pwd2020Db
|
||||||
|
# - MSSQL_PID=Express
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
dbgate-data:
|
dbgate-data:
|
||||||
driver: local
|
driver: local
|
@ -24,6 +24,20 @@ function extractTediousColumns(columns, addDriverNativeColumn = false) {
|
|||||||
|
|
||||||
async function tediousConnect({ server, port, user, password, database, ssl }) {
|
async function tediousConnect({ server, port, user, password, database, ssl }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
const connectionOptions = {
|
||||||
|
encrypt: !!ssl,
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (database) {
|
||||||
|
connectionOptions.database = database;
|
||||||
|
}
|
||||||
|
|
||||||
const connection = new tedious.Connection({
|
const connection = new tedious.Connection({
|
||||||
server,
|
server,
|
||||||
|
|
||||||
@ -35,16 +49,7 @@ async function tediousConnect({ server, port, user, password, database, ssl }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
options: {
|
options: connectionOptions,
|
||||||
encrypt: !!ssl,
|
|
||||||
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,
|
|
||||||
database,
|
|
||||||
port: port ? parseInt(port) : undefined,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
connection.on('connect', function (err) {
|
connection.on('connect', function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user