slate/node_common/data/utilities.js

14 lines
290 B
JavaScript
Raw Normal View History

import DB from "~/node_common/database";
export const runQuery = async ({ queryFn, errorFn, label }) => {
let response;
try {
response = await queryFn(DB);
} catch (e) {
response = errorFn(e);
}
console.log("[ database-query ]", { query: label });
return response;
};