Update stuff.
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run

This commit is contained in:
yuanhau 2025-07-06 18:33:52 +08:00
parent c81767b903
commit ea58cf5208
6 changed files with 46 additions and 30 deletions

View file

@ -0,0 +1,16 @@
import sql from "~/server/components/postgres";
interface variReturn {
name: string;
var: string;
}
export default async function (vari: string) {
const fetchVar = await sql<variReturn[]>`
SELECT * FROM global_vars
WHERE NAME = ${vari}`;
if (fetchVar.length === 0) {
throw new Error(
"Cannot find var in the database. Have you followed this? https://github.com/hpware/news-analyze?tab=readme-ov-file#notes",
);
}
return fetchVar[0].var;
}