|
|
@ -31,17 +31,15 @@ export default class LowDB extends DatabaseProvider { |
|
|
*/ |
|
|
*/ |
|
|
async connect() { |
|
|
async connect() { |
|
|
try { |
|
|
try { |
|
|
// load file db
|
|
|
await this.__init(); |
|
|
await this.#db.read(); |
|
|
DEBUG('Running Migrations'); |
|
|
DEBUG('Connected successfully'); |
|
|
await migrationRunner(this.#db); |
|
|
return; |
|
|
DEBUG('Migrations ran successfully'); |
|
|
} catch (error) { |
|
|
} catch (e) { |
|
|
DEBUG('Database does not exist : ', error); |
|
|
DEBUG(e); |
|
|
|
|
|
throw new DatabaseError(DatabaseError.ERROR_INIT); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await this.__init(); |
|
|
|
|
|
await migrationRunner(this.#db); |
|
|
|
|
|
|
|
|
|
|
|
DEBUG('Connected successfully'); |
|
|
DEBUG('Connected successfully'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|