From 55a4f1fc869e41aca748c63d3018f0448b1606e0 Mon Sep 17 00:00:00 2001 From: pack Date: Sun, 9 Aug 2026 10:37:07 +0000 Subject: first commit --- db.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 db.js (limited to 'db.js') diff --git a/db.js b/db.js new file mode 100644 index 0000000..1ca5195 --- /dev/null +++ b/db.js @@ -0,0 +1,9 @@ +const sqlite3 = require('sqlite3').verbose(); +const db = new sqlite3.Database('./app.db'); +db.serialize(() => { + db.run(`CREATE TABLE IF NOT EXISTS users ( + id INTEGER PRIMARY KEY, username TEXT UNIQUE, password TEXT)`); + db.run(`CREATE TABLE IF NOT EXISTS items ( + id INTEGER PRIMARY KEY, user_id INTEGER, title TEXT, content TEXT)`); +}); +module.exports = db; -- cgit v1.2.3