Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit 0946d63

Browse files
authored
Merge pull request #53 from 2Toad/1.6.0
1.6.0
2 parents 162a7d6 + 4c73120 commit 0946d63

File tree

8 files changed

+631
-1365
lines changed

8 files changed

+631
-1365
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ pids
99
*.seed
1010
*.pid.lock
1111

12+
# IntelliJ/Webstorm
13+
*.iml
14+
.idea/
15+
1216
# Directory for instrumented libs generated by jscoverage/JSCover
1317
lib-cov
1418

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
language: node_js
22
node_js:
3-
- "8"
4-
- "7"
5-
- "6"
6-
cache: yarn
7-
script: yarn lint
3+
- 8
4+
- 7
5+
- 6

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ var config = {
6666
interval: 60000,
6767
query: 'SELECT 1',
6868
enabled: true
69-
}
69+
},
70+
jvmOptions: ['-Xrs']
7071
};
7172
```
7273

docs/config.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The node-teradata constructor requires a config object:
1313
| maxPoolSize | number | When a connection is requested, and the pool is empty, a new connection will be added to the pool until this number is reached | 100 |
1414
| keepalive | object | (see [keepAlive Properties](#keepalive-properties)) | --- |
1515
| logger | object | (see [logger Properties](#logger-properties)) | --- |
16+
| jvmOptions | array | An array of strings of jvm options (Your array will not be merged with the default array, it will replace it) | ['-Xrs'] |
1617

1718
### keepalive Properties
1819
| Property | Type | Details | Default |
@@ -44,6 +45,7 @@ var config = {
4445
},
4546
logger: {
4647
level: 'debug'
47-
}
48+
},
49+
jvmOptions: ['-Xrs']
4850
};
4951
```

lib/teradata.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ function Teradata(config) {
2929
},
3030
logger: {
3131
level: 'error'
32-
}
32+
},
33+
jvmOptions: ['-Xrs']
3334
});
3435

3536
log.init(this.config.logger);
@@ -216,7 +217,7 @@ function parseNamedParameters(sql, params) {
216217
var filtered = _.filter(params, {'index': match});
217218
if (filtered.length > 1) throw new Error('Duplicate named parameter: ' + match);
218219

219-
var param = filtered[0];
220+
var param = _.clone(filtered[0]);
220221
if (!param) throw new Error('Missing named parameter: ' + match);
221222

222223
param.index = index + 1;
@@ -278,7 +279,9 @@ function initialize() {
278279
if (this.initialized) return Promise.resolve(this.pool);
279280

280281
if (!jinst.isJvmCreated()) {
281-
jinst.addOption('-Xrs');
282+
this.config.jvmOptions.forEach(function(opt) {
283+
jinst.addOption(opt);
284+
});
282285
jinst.setupClasspath([
283286
this.config.driver + 'terajdbc4.jar',
284287
this.config.driver + 'tdgssconfig.jar'

0 commit comments

Comments
 (0)