fix: removed collage
fix: removing collage feat: added ingredient type to server for testing and a config" chore: setup deno server package
This commit is contained in:
16
server/database.ts
Normal file
16
server/database.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user