diff --git a/backend/sql/mysql.ts b/backend/sql/mysql.ts index 544e7b5..e26dc0a 100644 --- a/backend/sql/mysql.ts +++ b/backend/sql/mysql.ts @@ -129,4 +129,24 @@ VALUES ('${key}', '${JSON.stringify(data)}'); } }); } + + // todo: unknown if this works + public static getAll(table: TableNamesType): Promise { + 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); + } + }); + } }