forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmssql2.js
More file actions
34 lines (28 loc) · 860 Bytes
/
mssql2.js
File metadata and controls
34 lines (28 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Adapted from https://github.com/tediousjs/node-mssql#readme
const sql = require('mssql')
const request = new sql.Request()
request.query('select 1 as number', (err, result) => {
// ... error checks
console.log(result.recordset[0].number) // return 1
// ...
})
request.batch('create procedure #temporary as select * from table', (err, result) => {
// ... error checks
})
class C {
constructor(req) {
this.req = req;
}
send() {
this.req.query('select 1 as number', (err, result) => { })
}
}
new C(new sql.Request());
var obj = {
foo: function () {
return request.batch('create procedure #temporary as select * from table', (err, result) => {
// ... error checks
})
}
}
obj.foo("foo", "bar", "baz"); // An API-graphs gotcha: "baz" should not be considered a `SqlString`