This commit is contained in:
Benjamin Toby
2025-01-14 11:14:50 +01:00
parent edd555c088
commit d55fe64d47
30 changed files with 225 additions and 481 deletions
+2 -13
View File
@@ -15,25 +15,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.default = dbHandler;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const serverless_mysql_1 = __importDefault(require("serverless-mysql"));
const grab_dsql_connection_1 = __importDefault(require("../../utils/grab-dsql-connection"));
/**
* # Main DB Handler Function
* @requires DSQL_DB_CONN - Gobal Variable for Datasquirel Database
*/
function dbHandler(_a) {
return __awaiter(this, arguments, void 0, function* ({ query, values, }) {
const CONNECTION = (0, serverless_mysql_1.default)({
config: {
host: process.env.DSQL_DB_HOST,
user: process.env.DSQL_DB_USERNAME,
password: process.env.DSQL_DB_PASSWORD,
database: process.env.DSQL_DB_NAME,
port: process.env.DSQL_DB_PORT
? Number(process.env.DSQL_DB_PORT)
: undefined,
charset: "utf8mb4",
},
});
const CONNECTION = (0, grab_dsql_connection_1.default)();
let results;
try {
if (query && values) {