diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index ec5fecf95a..f7feaeabe9 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -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; diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 6e49702faf..2883f57670 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -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,