Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
14 lines
289 B
TypeScript
14 lines
289 B
TypeScript
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);
|
|
|
|
if (!fs.existsSync(dir)) {
|
|
fs.mkdirSync(dir);
|
|
}
|
|
|
|
export const db = new Database(fullPath);
|