Add method to interface
This commit is contained in:
1 parent
2422fcc83b
commit
ee74584699
2 files changed
+8
No files matched your search
@@ -1,4 +1,7 @@
|
|||||||
|
import { Pool } from "pg";
|
||||||
|
|
||||||
export interface IDb {
|
export interface IDb {
|
||||||
connect(): Promise<void>;
|
connect(): Promise<void>;
|
||||||
disconnect(): Promise<void>;
|
disconnect(): Promise<void>;
|
||||||
|
getPool(): Pool | null;
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,7 @@ import { ILogger } from "@/utils/logger.js";
|
|||||||
import { EnvConfig } from "@/service/system/settingsService.js";
|
import { EnvConfig } from "@/service/system/settingsService.js";
|
||||||
const SERVICE_NAME = "MongoDB";
|
const SERVICE_NAME = "MongoDB";
|
||||||
import { IDb } from "@/db/IDb.js";
|
import { IDb } from "@/db/IDb.js";
|
||||||
|
import { Pool } from "pg";
|
||||||
|
|
||||||
class MongoDB implements IDb {
|
class MongoDB implements IDb {
|
||||||
static SERVICE_NAME = SERVICE_NAME;
|
static SERVICE_NAME = SERVICE_NAME;
|
||||||
@@ -74,6 +75,10 @@ class MongoDB implements IDb {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getPool = () => {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MongoDB;
|
export default MongoDB;
|
||||||
Reference in new issue
Block a user