datasquirel/dist/package-shared/utils/backend/global-db/LOCAL_DB_HANDLER.js
Benjamin Toby 7e8bb37c09 Updates
2025-07-05 14:59:30 +01:00

23 lines
677 B
JavaScript

import grabDSQLConnection from "../../grab-dsql-connection";
/**
* # DSQL user read-only DB handler
*/
export default async function LOCAL_DB_HANDLER(...args) {
var _a;
const MASTER = grabDSQLConnection();
try {
const results = await MASTER.query(...args);
return JSON.parse(JSON.stringify(results));
}
catch (error) {
(_a = global.ERROR_CALLBACK) === null || _a === void 0 ? void 0 : _a.call(global, `LOCAL_DB_HANDLER Error`, error);
return {
success: false,
error: error.message,
};
}
finally {
await (MASTER === null || MASTER === void 0 ? void 0 : MASTER.end());
}
}