feat: improving infrastructure

This commit is contained in:
Daniel Ledda
2022-06-30 08:33:13 +02:00
parent bd177c7f09
commit 3e5c53f9f5
12 changed files with 76 additions and 61 deletions

View File

@@ -1,5 +1,6 @@
import { Client } from "https://deno.land/x/mysql/mod.ts";
import config from "@/config.json" assert { type: "json" };
import config from "./config.json" assert { type: "json" };
import {Maybe} from "./Maybe.ts";
export type WithoutId<T> = Omit<T, "id">;
export interface StoccaTreDbConn {
@@ -19,7 +20,6 @@ export default async function createNewDbConnection(): Promise<StoccaTreDbConn>
const result = await mysqlClient.query(query);
return {
just: result as T,
error: null,
};
} catch (e: unknown) {
if (e && typeof (e as { message?: any }).message === "string") {
@@ -29,7 +29,6 @@ export default async function createNewDbConnection(): Promise<StoccaTreDbConn>
}
}
return {
just: null,
error: {
message: errMessage
},