make sure the DB is initiated
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good

This commit is contained in:
2025-10-14 09:48:04 +02:00
parent 5082e6d526
commit 662211e1c3
2 changed files with 4 additions and 10 deletions

View File

@@ -1,13 +1,7 @@
import Database from 'better-sqlite3';
import fs from 'fs';
import path from 'path';
import { DB_FULLPATH } from '../../routes';
const fullPath = DB_FULLPATH;
const dir = path.dirname(fullPath);
// make sure the DB is initiated
import '../../init/init_db'
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
export const db = new Database(fullPath);
export const db = new Database(DB_FULLPATH);

View File

@@ -39,4 +39,4 @@ export const API_ROUTES = {
USER: (userId: string) => `/api/users/${userId}`
};
export const DB_FULLPATH = dev ? './src/lib/data/tatort.db' : '/daten/tatort.db'
export const DB_FULLPATH = dev ? './src/lib/data/tatort.db' : '/daten/tatort.db';