diff options
Diffstat (limited to 'src/util/server.ts')
-rw-r--r-- | src/util/server.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/server.ts b/src/util/server.ts new file mode 100644 index 0000000..665c14f --- /dev/null +++ b/src/util/server.ts @@ -0,0 +1,14 @@ +import DBController from "../db/DBController.ts"; +import * as log from "https://deno.land/std/log/mod.ts"; + +const controller = new DBController(); + +export const isSetup = async (): Promise<boolean> => { + try { + const users = await controller.query("SELECT id FROM users"); + return users.length > 0 + } catch (e) { + log.error(e); + return false; + } +} |