1
0
Fork 0

Finish moving from SQL to New Funny ORM

This commit is contained in:
Cadence Ember 2023-09-18 22:51:59 +12:00
parent 4e1e590c3a
commit 79bd0254f0
19 changed files with 87 additions and 87 deletions

View file

@ -3,7 +3,7 @@
const fetch = require("node-fetch").default
const passthrough = require("../passthrough")
const { sync, db } = passthrough
const {sync, db, select} = passthrough
/** @type {import("./mreq")} */
const mreq = sync.require("./mreq")
@ -33,7 +33,7 @@ async function uploadDiscordFileToMxc(path) {
}
// Has this file already been uploaded in the past? Grab the existing copy from the database.
const existingFromDb = db.prepare("SELECT mxc_url FROM file WHERE discord_url = ?").pluck().get(url)
const existingFromDb = select("file", "mxc_url", "WHERE discord_url = ?").pluck().get(url)
if (typeof existingFromDb === "string") {
return existingFromDb
}