Skip to content

Commit ac2c211

Browse files
feat: add --tds-version flag on bin file as option from cli
1 parent 973b131 commit ac2c211

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/mssql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ async function resolveConfig (opts, cfgFile) {
3030
const cfg = Object.entries({
3131
options: {
3232
encrypt: opts.encrypt,
33-
trustServerCertificate: opts.trustServerCertificate
33+
trustServerCertificate: opts.trustServerCertificate,
34+
tdsVersion: opts.tdsVersion
3435
},
3536
user: opts.user,
3637
password: opts.password,
@@ -61,8 +62,8 @@ async function resolveConfig (opts, cfgFile) {
6162
...config,
6263
...cfg,
6364
options: {
65+
...cfg.options,
6466
...(config.options || {}),
65-
...cfg.options
6667
}
6768
}
6869
}
@@ -82,6 +83,7 @@ program
8283
.option('--port <port>', 'Port for the database connection', parseInt)
8384
.option('--encrypt', 'Use the encrypt option for this connection', false)
8485
.option('--trust-server-certificate', 'Trust the server certificate for this connection', false)
86+
.option('--tds-version <version>', 'TDS version to use for the database connection', '7_4')
8587
// .option('--format <format>', 'The output format to use, eg: JSON', 'json')
8688
.action(async function (configPath, opts) {
8789
const [config, statement] = await Promise.all([

0 commit comments

Comments
 (0)