This repository was archived by the owner on Feb 10, 2022. It is now read-only.
This repository was archived by the owner on Feb 10, 2022. It is now read-only.
Move certain settings stored in DB to JSON string saved in LONGTEXT #21
Open
Description
This would allow for not needing stuff like this:
let results = await sqlPool.query(`
SELECT botID, channelID, SUB, SUB_T2, SUB_T3, SUB_PRIME, RESUB, RESUB_T2, RESUB_T3, RESUB_PRIME, SUBGIFT, ANONSUBGIFT, SUBMYSTERGIFT, GIFTPAIDUPGRADE, ANONGIFTPAIDUPGRADE, REWARDGIFT, RAID, RITUAL
FROM notifications
WHERE botID = ?;
`, botID)
// ...
but instead something like this:
let results = await sqlPool.query(`
SELECT botID, channelID, data
FROM notifications
WHERE botID = ?;
`, botID)
// ...
return results.map((line) => {line.data = JSON.parse(line.data)})