2019-01-13 05:38:49 +01:00
|
|
|
const QueryRunner = require('./QueryRunner');
|
2014-10-29 08:02:03 +01:00
|
|
|
|
2019-01-12 11:43:36 +01:00
|
|
|
let singleton = null;
|
2014-10-29 08:02:03 +01:00
|
|
|
|
2017-08-09 11:05:55 +02:00
|
|
|
class Gamedig {
|
2021-05-19 06:13:18 +02:00
|
|
|
constructor(runnerOpts) {
|
|
|
|
this.queryRunner = new QueryRunner(runnerOpts);
|
2019-01-12 11:43:36 +01:00
|
|
|
}
|
2017-03-14 09:40:02 +01:00
|
|
|
|
2019-01-12 11:43:36 +01:00
|
|
|
async query(userOptions) {
|
|
|
|
return await this.queryRunner.run(userOptions);
|
|
|
|
}
|
2014-10-29 08:02:03 +01:00
|
|
|
|
2019-01-12 11:43:36 +01:00
|
|
|
static getInstance() {
|
2019-01-13 05:38:49 +01:00
|
|
|
if (!singleton) singleton = new Gamedig();
|
2019-01-12 11:43:36 +01:00
|
|
|
return singleton;
|
|
|
|
}
|
2019-01-13 05:38:49 +01:00
|
|
|
static async query(...args) {
|
|
|
|
return await Gamedig.getInstance().query(...args);
|
2017-08-09 12:32:09 +02:00
|
|
|
}
|
2017-08-09 11:05:55 +02:00
|
|
|
}
|
2014-10-29 08:02:03 +01:00
|
|
|
|
|
|
|
module.exports = Gamedig;
|