-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zetxx
committed
Aug 19, 2021
1 parent
f44fadf
commit edd8234
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const sql = require('mssql'); | ||
|
||
const query = (async() => { | ||
const { | ||
server, | ||
user, | ||
password, | ||
pool, | ||
database, | ||
options | ||
} = require('../mssql.config.js'); | ||
const cPool = await sql.connect({ | ||
server, | ||
user, | ||
password, | ||
pool, | ||
database, | ||
options | ||
}); | ||
return async(q) => { | ||
try { | ||
return await cPool.request().query(q); | ||
} catch (e) { | ||
console.warn(q); | ||
console.error(e); | ||
throw e; | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// require('./test.dummy'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const tap = require('tap'); | ||
|
||
tap.test('Dummy', (t) => { | ||
t.same( | ||
1, | ||
1, | ||
'should be same' | ||
); | ||
t.end(); | ||
}); | ||
|