mirror of
https://github.com/mudabbir-ahmad/peworkshop.git
synced 2026-10-08 03:50:21 +00:00
redo of entire app
This commit is contained in:
1 parent
7dee4879a7
commit
093dd7ea9e
45 files changed
+686
-5659
No files matched your search
@@ -0,0 +1,17 @@
|
||||
const Database = require('better-sqlite3');
|
||||
|
||||
// Initialize the database connection
|
||||
const db = new Database('./clue_hunt.db');
|
||||
|
||||
// Helper function to run queries
|
||||
function query(sql, params) {
|
||||
try {
|
||||
const stmt = db.prepare(sql);
|
||||
return params ? stmt.all(params) : stmt.all();
|
||||
} catch (err) {
|
||||
console.error('Error executing query:', err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { query };
|
||||
Reference in new issue
Block a user