0.4.0b2 database fix (and dotenv loading)

This commit is contained in:
Yusur 2026-02-25 11:59:17 +01:00
parent 5b98a2e98a
commit 9919e74836
7 changed files with 49 additions and 22 deletions

View file

@ -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