fix: removing collage feat: added ingredient type to server for testing and a config" chore: setup deno server package
17 lines
512 B
TypeScript
17 lines
512 B
TypeScript
import { Client } from "https://deno.land/x/mysql/mod.ts";
|
|
import dbconfig from "./config.json" assert { type: "json" };
|
|
|
|
export type WithoutId<T> = Omit<T, "id">;
|
|
export interface StoccaTreDbConn {
|
|
query<T>(query: string): Promise<T>;
|
|
}
|
|
export default async function createNewDbConnection(): Promise<StoccaTreDbConn> {
|
|
return await new Client().connect({
|
|
hostname: dbconfig.hostname,
|
|
username: dbconfig.username,
|
|
db: "stocca_tre",
|
|
password: dbconfig.password,
|
|
});
|
|
}
|
|
|