mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 21:31:12 +08:00
adds mssql configuration options (#15493)
This commit is contained in:
21
types/knex/index.d.ts
vendored
21
types/knex/index.d.ts
vendored
@@ -456,7 +456,7 @@ declare namespace Knex {
|
||||
client?: string;
|
||||
dialect?: string;
|
||||
connection?: string | ConnectionConfig | MariaSqlConnectionConfig |
|
||||
MySqlConnectionConfig | Sqlite3ConnectionConfig | SocketConnectionConfig;
|
||||
MySqlConnectionConfig | MsSqlConnectionConfig | Sqlite3ConnectionConfig | SocketConnectionConfig;
|
||||
pool?: PoolConfig;
|
||||
migrations?: MigratorConfig;
|
||||
acquireConnectionTimeout?: number;
|
||||
@@ -475,6 +475,14 @@ declare namespace Knex {
|
||||
requestTimeout?: number;
|
||||
}
|
||||
|
||||
interface MsSqlConnectionConfig {
|
||||
user: string;
|
||||
password: string;
|
||||
server: string;
|
||||
database: string;
|
||||
options: MsSqlOptionsConfig;
|
||||
}
|
||||
|
||||
// Config object for mariasql: https://github.com/mscdex/node-mariasql#client-methods
|
||||
interface MariaSqlConnectionConfig {
|
||||
user?: string;
|
||||
@@ -539,6 +547,17 @@ declare namespace Knex {
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
interface MsSqlOptionsConfig {
|
||||
encrypt?: boolean;
|
||||
port?: number;
|
||||
domain?: string;
|
||||
connectionTimeout?: number;
|
||||
requestTimeout?: number;
|
||||
stream?: boolean;
|
||||
parseJSON?: boolean;
|
||||
pool?: PoolConfig;
|
||||
}
|
||||
|
||||
interface SocketConnectionConfig {
|
||||
socketPath: string;
|
||||
user: string;
|
||||
|
||||
@@ -22,6 +22,19 @@ var knex = Knex({
|
||||
}
|
||||
});
|
||||
|
||||
var knex = Knex({
|
||||
debug: true,
|
||||
client: 'mssql',
|
||||
connection: {
|
||||
user : 'your_database_user',
|
||||
password: 'your_database_password',
|
||||
server : 'your_database_server',
|
||||
options : {
|
||||
database: 'myapp_test'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Mariasql configuration
|
||||
var knex = Knex({
|
||||
debug: true,
|
||||
|
||||
Reference in New Issue
Block a user