Add a configuration config object that supports mariasql client syntax

This commit is contained in:
Jon Sheppard
2016-02-17 23:00:21 +11:00
parent b57c33fec0
commit 51e1f71209
2 changed files with 21 additions and 1 deletions
+12
View File
@@ -22,6 +22,18 @@ var knex = Knex({
}
});
// Mariasql configuration
var knex = Knex({
debug: true,
client: 'mariasql',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
db : 'myapp_test'
}
});
// Pooling
var knex = Knex({
client: 'mysql',
+9 -1
View File
@@ -399,7 +399,7 @@ declare module "knex" {
debug?: boolean;
client?: string;
dialect?: string;
connection: string|ConnectionConfig|
connection: string|ConnectionConfig|MariaSqlConnectionConfig|
Sqlite3ConnectionConfig|SocketConnectionConfig;
pool?: PoolConfig;
migrations?: MigrationConfig;
@@ -413,6 +413,14 @@ declare module "knex" {
debug?: boolean;
}
interface MariaSqlConnectionConfig {
host: string;
user: string;
password: string;
db: string;
debug?: boolean;
}
/** Used with SQLite3 adapter */
interface Sqlite3ConnectionConfig {
filename: string;