feat: Introduce database count verification scripts and update Next.js configuration for pg and server action body size.

This commit is contained in:
Michael committed 2026-03-10 13:37:13 +01:00
1 parent f15fbe69ec
commit 08d361e980
3 files changed
+56 -1

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { db } from "./src/db";
import { sql } from "drizzle-orm";
async function check() {
try {
const res = await db.execute(sql`SELECT COUNT(*) FROM ventes_produits`);
console.log("Total rows in ventes_produits:", res.rows[0].count);
const resDistinct = await db.execute(sql`SELECT COUNT(DISTINCT codein) FROM ventes_produits`);
console.log("Total distinct codein in ventes_produits:", resDistinct.rows[0].count);
const resSupplier = await db.execute(sql`SELECT code_fournisseur, COUNT(*) as row_count, COUNT(DISTINCT codein) as prod_count FROM ventes_produits GROUP BY code_fournisseur`);
console.log("Counts per supplier:", resSupplier.rows);
} catch (e) {
console.error("Error:", e);
}
}
check();