Merge pull request #28082 from ulrichb/MssqlEnableMsnodesqlv8

[mssql] Add typings for "mssql/msnodesqlv8"
This commit is contained in:
Daniel Rosenwasser
2018-08-28 09:46:42 -07:00
committed by GitHub
4 changed files with 12 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
// Peter Keuter <https://github.com/pkeuter>
// David Gasperoni <https://github.com/mcdado>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="node" />

2
types/mssql/msnodesqlv8.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
// Export the same API as index.d.ts (which implicitly uses the "msnodesqlv8" driver):
export * from '.';

View File

@@ -1,4 +1,5 @@
import * as sql from 'mssql';
import * as msnodesqlv8 from 'mssql/msnodesqlv8';
interface Entity {
value: number;
@@ -203,3 +204,10 @@ function test_classes_extend_eventemitter() {
preparedStatment.on('error', () => { })
}
async function test_msnodesqlv8() {
const connection = new msnodesqlv8.ConnectionPool({ server: "localhost", database: "master", options: { trustedConnection: true } });
await connection.connect();
const result = await connection.query`SELECT * FROM sys.databases`;
await connection.close();
}

View File

@@ -18,6 +18,7 @@
},
"files": [
"index.d.ts",
"msnodesqlv8.d.ts",
"mssql-tests.ts"
]
}