update db management scripts to bun
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user