feat: added UNTESTED MySQL getAll

pull/239/head
Josh Moore 1 year ago
parent c257718410
commit b4ebe8b5d5

@ -129,4 +129,24 @@ VALUES ('${key}', '${JSON.stringify(data)}');
} }
}); });
} }
// todo: unknown if this works
public static getAll(table: TableNamesType): Promise<UploadToken | AssFile | AssUser | undefined> {
return new Promise(async (resolve, reject) => {
try {
// Run query // ! this may not work as expected
const [rowz, _fields] = await MySql._pool.query(`SELECT Data FROM ${table}`);
// Interpret results this is pain
const rows = (rowz as unknown as { [key: string]: string }[]);
// console.log(rows);
// aaaaaaaaaaaa
resolve(undefined);
} catch (err) {
reject(err);
}
});
}
} }

Loading…
Cancel
Save