const Database = require('better-sqlite3');
const fs = require('fs');
const db = new Database('./data/metadata.db');

try {
    const rows = db.prepare("SELECT id, name, modelId, type, tenant_id FROM model_configs").all();
    fs.writeFileSync('models_list.json', JSON.stringify(rows, null, 2));
} catch (err) {
    console.error(err);
} finally {
    db.close();
}
