Co-authored-by: Cursor <[email protected]>
This commit is contained in:
lejay
2026-05-28 07:20:38 +02:00
co-authored by Cursor
parent 6923c319a1
commit 6c0d7e47b8
81 changed files with 21780 additions and 2986 deletions
+24
View File
@@ -0,0 +1,24 @@
import { query } from '../db/index.js';
async function main() {
const tables = (await query("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name")).rows.map(
(r) => r.name
);
console.log('tables', tables);
const counts = ['formex_materials', 'formex_variants', 'formex_dimensions', 'finishes', 'products', 'suppliers'];
for (const t of counts) {
try {
const r = await query(`SELECT COUNT(*) as c FROM ${t}`);
console.log(t, r.rows[0]?.c);
} catch {
console.log(t, '(missing)');
}
}
}
main().catch((err) => {
console.error(err);
process.exit(1);
});