Initial commit of Step Admin panel
This commit is contained in:
14
src/lib/server/db.ts
Normal file
14
src/lib/server/db.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import Database from 'better-sqlite3';
|
||||
import { env } from '$env/dynamic/private';
|
||||
import path from 'path';
|
||||
|
||||
// Store DB in the data directory
|
||||
const dbPath = path.resolve('./data/app.db');
|
||||
const db = new Database(dbPath);
|
||||
|
||||
db.pragma('journal_mode = WAL');
|
||||
|
||||
// Provide simple helper to get DB instance
|
||||
export function getDb() {
|
||||
return db;
|
||||
}
|
||||
Reference in New Issue
Block a user