main: removed dead code and better-sqlite

Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
2025-12-30 01:37:05 +03:30
parent 895afc44af
commit c33570d3ec
3 changed files with 1 additions and 80 deletions
+1 -10
View File
@@ -10,18 +10,9 @@ const dbPath = path.join(process.cwd(), "data", "parsa.db");
let db: any;
function createDatabase() {
// Use Bun's native SQLite if available, otherwise use better-sqlite3
const isBun = typeof Bun !== "undefined";
// Use Bun's native SQLite
const { Database } = require("bun:sqlite");
return new Database(dbPath, { create: true });
if (isBun) {
const { Database } = require("bun:sqlite");
return new Database(dbPath, { create: true });
} else {
const Database = require("better-sqlite3");
return new Database(dbPath);
}
}
export function getDatabase(): any {