adds mssql configuration options (#15493)

This commit is contained in:
Craig Bassett
2017-04-17 10:04:31 -05:00
committed by Andy
parent 9e2f362ab3
commit fe9c76bb27
2 changed files with 33 additions and 1 deletions

21
types/knex/index.d.ts vendored
View File

@@ -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;

View File

@@ -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,