0.4.0b2 database fix (and dotenv loading)
This commit is contained in:
parent
5b98a2e98a
commit
9919e74836
7 changed files with 49 additions and 22 deletions
18
src/main.ts
18
src/main.ts
|
|
@ -1,17 +1,19 @@
|
|||
|
||||
import init from "./initConfig";
|
||||
import { configDotenv } from "dotenv";
|
||||
|
||||
init();
|
||||
configDotenv(); // apparently init does not get executed
|
||||
|
||||
const client = (await import("./bot")).default;
|
||||
|
||||
import client from "./bot";
|
||||
|
||||
// query TEST
|
||||
import { db } from "./db/database";
|
||||
import { count } from "drizzle-orm";
|
||||
import { users } from "./db/schema";
|
||||
import chalk from "chalk";
|
||||
(async function () {
|
||||
const uCount = await db.select({ count: count() }).from(users);
|
||||
// async imports because yes
|
||||
const { db } = await import("./db/database");
|
||||
const { count } = await import("drizzle-orm");
|
||||
const { users } = await import("./db/schema");
|
||||
const chalk = (await import("chalk")).default;
|
||||
const uCount = (await db.select({ count: count() }).from(users))[0].count;
|
||||
console.log(`Watching over ${chalk.bold(uCount)} users`);
|
||||
})().then(() => { });
|
||||
// END query TEST
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue