update db management scripts to bun

This commit is contained in:
2025-05-24 16:24:05 +02:00
parent d50499f41f
commit dd343656cb
3 changed files with 5 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
import fs from 'fs';
import Database from 'better-sqlite3';
import { Database } from 'bun:sqlite';
const dbName = 'strimserve.db';

View File

@@ -1,6 +1,6 @@
import fs from 'fs';
import path from 'path';
import Database from 'better-sqlite3';
import { Database } from 'bun:sqlite';
import dotenv from 'dotenv';
dotenv.config({ path: '../.env' });
@@ -23,7 +23,7 @@ const lookup = {
};
// Retrieve existing IDs from Stream
const existingIds = db.prepare('SELECT id FROM Stream').pluck().all();
const existingIds = db.prepare('SELECT id FROM Stream').all().map(row => row.id);
// Create a set of existing IDs for efficient lookup
const idSet = new Set(existingIds);