main: removed dead code and better-sqlite
Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user