mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Added connection
method to database info lib
- this allows you to pass in a different DB instance than the one that the library is initialized with
This commit is contained in:
parent
bb04fc49da
commit
d8d77ed0ba
@ -95,4 +95,15 @@ module.exports = class DatabaseInfo {
|
||||
isMySQL() {
|
||||
return ['mysql', 'mysql2'].includes(this._driver);
|
||||
}
|
||||
|
||||
/**
|
||||
* This allows you to use a different DB connection than the one we initialized the lib with
|
||||
*
|
||||
* @param {import('knex')} knex
|
||||
*
|
||||
* @returns DatabaseInfo
|
||||
*/
|
||||
connection(knex) {
|
||||
return new DatabaseInfo(knex);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user