import dbHandler from "./dbHandler"; /** * # Create database from Schema Function */ export default async function noDatabaseDbHandler( queryString: string ): Promise { /** * Declare variables * * @description Declare "results" variable */ let results; /** * Fetch from db * * @description Fetch data from db if no cache */ try { /** ********************* Run Query */ results = await dbHandler({ query: queryString }); //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// } catch (error: any) { console.log("ERROR in noDatabaseDbHandler =>", error.message); } /** * Return results * * @description Return results add to cache if "req" param is passed */ if (results) { return results; } else { return null; } }