From 51e1f71209f2e2a357f8e15fd732d4cd78b78580 Mon Sep 17 00:00:00 2001 From: Jon Sheppard Date: Wed, 17 Feb 2016 23:00:21 +1100 Subject: [PATCH] Add a configuration config object that supports mariasql client syntax --- knex/knex-tests.ts | 12 ++++++++++++ knex/knex.d.ts | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index 83b476b16..9ec619e8a 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -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', diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 49fb30ae0..224de6756 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -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;