refactor(sql): moved new queries to there own folder to make it more easy to work and migrate

This commit is contained in:
2026-02-16 19:01:23 -06:00
parent ace73fa919
commit 44d0cb63cf
5 changed files with 51 additions and 2 deletions

View File

@@ -1,14 +1,21 @@
import { readFileSync } from "fs";
export type SqlQuery = {
query: string;
success: boolean;
message: string;
};
export const sqlQuerySelector = (name: string) => {
try {
const queryFile = readFileSync(
new URL(`../querys/${name}.sql`, import.meta.url),
new URL(`../querys/newQueries/${name}.sql`, import.meta.url),
"utf8",
);
return {
success: true,
message: `Query for: ${name}`,
query: queryFile,
};
} catch (error) {