First working version.

This commit is contained in:
2026-06-24 17:00:14 +01:00
parent 44f6c18a84
commit b5e4724e03
9 changed files with 92 additions and 151 deletions
+4 -2
View File
@@ -17,8 +17,6 @@ export default async function dbHandler<
const res = await MariaDBClient.unsafe(query, values);
const count = res.count;
const last_insert_id = res.lastInsertRowid;
const affected_rows = res.affectedRows;
const res_array = (() => {
try {
@@ -28,6 +26,9 @@ export default async function dbHandler<
}
})();
const last_insert_id = res_array?.[0] ? res_array[0]?.id : undefined;
const affected_rows = res_array?.[0] ? res_array.length : undefined;
const insert_return: DBInsertReturn = {
count,
last_insert_id,
@@ -39,6 +40,7 @@ export default async function dbHandler<
payload: res_array,
single_res: res_array?.[0],
insert_return,
count,
};
} catch (error: any) {
return {