2023-09-14 22:28:31 +02:00
|
|
|
import QueryRunner from './QueryRunner.js';
|
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
|
|
|
|
2023-09-14 22:28:31 +02:00
|
|
|
export default 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() {
|
2023-09-13 16:31:58 +02:00
|
|
|
if (!singleton)
|
|
|
|
singleton = new Gamedig();
|
|
|
|
|
2019-01-12 11:43:36 +01:00
|
|
|
return singleton;
|
|
|
|
}
|
2023-09-13 16:31:58 +02:00
|
|
|
|
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
|
|
|
}
|