diff options
author | LarsVomMars | 2020-07-12 18:07:59 +0200 |
---|---|---|
committer | LarsVomMars | 2020-07-12 18:07:59 +0200 |
commit | e39dbbaeaee6d3dcf40bf74aba932aacfa34fa18 (patch) | |
tree | 09a40a99e40f765f569d14a7ce678df9135f27a5 /src/db/connector.ts | |
parent | 7023dc2a6920aa6389ac2b28bcdbaacdb4413e00 (diff) |
Example code
Diffstat (limited to 'src/db/connector.ts')
-rw-r--r-- | src/db/connector.ts | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/db/connector.ts b/src/db/connector.ts deleted file mode 100644 index 6b9bfec..0000000 --- a/src/db/connector.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Client } from "https://deno.land/x/mysql/mod.ts"; - -export default class Connector { - async connect(): Promise<Client> { - try { - return await new Client().connect({ - hostname: Deno.env.get("DBHost"), - username: Deno.env.get("DBUser"), - db: Deno.env.get("DBName"), - password: Deno.env.get("DBPassword"), - }); - } catch (e) { - console.error("Could not connect to database!"); - throw e; - } - } -} |