Add new WHERE feature to my funny orm

This commit is contained in:
Cadence Ember 2023-10-06 12:31:10 +13:00
parent 28abdac5b6
commit 475cd5b724
30 changed files with 149 additions and 105 deletions

View file

@ -14,7 +14,7 @@ const {discord, db, select} = passthrough
*/
async function ensureWebhook(channelID, forceCreate = false) {
if (!forceCreate) {
const row = select("webhook", ["webhook_id", "webhook_token"], "WHERE channel_id = ?").get(channelID)
const row = select("webhook", ["webhook_id", "webhook_token"], {channel_id: channelID}).get()
if (row) {
return {
id: row.webhook_id,