fix: corrupted data

This commit is contained in:
Aunali321 2025-08-10 03:42:55 +05:30
parent 2c8f863a49
commit 3ebe864b89

View file

@ -3,6 +3,7 @@ import { open } from 'sqlite';
import sqlite3 from 'sqlite3';
import { initialPrompts } from './data';
import { hash } from 'bcryptjs';
import path from 'path';
// Singleton pattern to ensure only one database connection is created.
let db: Awaited<ReturnType<typeof open>> | null = null;
@ -36,7 +37,7 @@ export async function getDb() {
await setupAdminPassword();
const newDb = await open({
filename: './database.db',
filename: path.join(process.cwd(), 'database.db'),
driver: sqlite3.Database,
});