mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 07:35:09 +00:00
30 lines
583 B
TypeScript
30 lines
583 B
TypeScript
import {
|
|
closeDatabaseHelper,
|
|
initDatabaseHelper,
|
|
} from "../helpers/database";
|
|
|
|
/**
|
|
* Class to handle database actions
|
|
*/
|
|
class DatabaseService {
|
|
/**
|
|
* Initialize database connection
|
|
* @param {Object} obj
|
|
* @param {String} obj.mongoURL - mongo connection string
|
|
* @returns
|
|
*/
|
|
static async initDatabase(MONGO_URL: string) {
|
|
return await initDatabaseHelper({
|
|
mongoURL: MONGO_URL,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Close database conection
|
|
*/
|
|
static async closeDatabase() {
|
|
return await closeDatabaseHelper();
|
|
}
|
|
}
|
|
|
|
export default DatabaseService; |