
import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3';
import Database from 'better-sqlite3';

try {
    console.log("Attempting incorrect usage...");
    // @ts-ignore
    new PrismaBetterSqlite3({ url: 'file:./dev.db' });
    console.log("Incorrect usage presumed worked? (Unexpected)");
} catch (e) {
    console.log("Incorrect usage failed as expected:", e.message);
}

try {
    console.log("Attempting correct usage...");
    const db = new Database('./dev.db');
    new PrismaBetterSqlite3(db);
    console.log("Correct usage worked.");
} catch (e) {
    console.log("Correct usage failed:", e);
}

try {
    console.log("Attempting correct usage with file: prefix...");
    const db = new Database('file:./dev.db');
    new PrismaBetterSqlite3(db);
    console.log("Correct usage with prefix worked.");
} catch (e) {
    console.log("Correct usage with prefix failed:", e.message);
}
