import grabDSQLConnection from "../../grab-dsql-connection"; /** * # DSQL user read-only DB handler * @requires DSQL_DB_CONN - Gobal Variable for Datasquirel Database */ export default async function DB_HANDLER(...args) { var _a; const CONNECTION = grabDSQLConnection(); try { if (!CONNECTION) throw new Error("No Connection provided to DB_HANDLER function!"); const results = await CONNECTION.query(...args); return JSON.parse(JSON.stringify(results)); } catch (error) { (_a = global.ERROR_CALLBACK) === null || _a === void 0 ? void 0 : _a.call(global, `DB_HANDLER Error`, error); return { success: false, error: error.message, }; } finally { await (CONNECTION === null || CONNECTION === void 0 ? void 0 : CONNECTION.end()); } }