mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-22 03:37:53 +08:00
Merge pull request #28082 from ulrichb/MssqlEnableMsnodesqlv8
[mssql] Add typings for "mssql/msnodesqlv8"
This commit is contained in:
1
types/mssql/index.d.ts
vendored
1
types/mssql/index.d.ts
vendored
@@ -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
2
types/mssql/msnodesqlv8.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// Export the same API as index.d.ts (which implicitly uses the "msnodesqlv8" driver):
|
||||
export * from '.';
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"msnodesqlv8.d.ts",
|
||||
"mssql-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user