require('dotenv').config(); const pool = require('../server/db'); const { loadPainterPalette, findPaletteRow } = require('./painter-palette-lib'); async function main() { const palette = loadPainterPalette(); const { rows: dbArtists } = await pool.query('SELECT name FROM artists ORDER BY name'); let matched = 0; const unmatched = []; for (const a of dbArtists) { if (findPaletteRow(a.name, palette)) matched += 1; else unmatched.push(a.name); } console.log('CSV rows:', palette.rowCount); console.log('DB artists:', dbArtists.length); console.log('Matched to PainterPalette:', matched, '/', dbArtists.length); if (unmatched.length) console.log('Unmatched:', unmatched.join('; ')); await pool.end(); } main().catch((err) => { console.error(err); process.exit(1); });