mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-22 06:28:09 +02:00
feat: Introduce database count verification scripts and update Next.js configuration for pg and server action body size.
This commit is contained in:
1 parent
f15fbe69ec
commit
08d361e980
3 files changed
+56
-1
No files matched your search
@@ -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();
|
||||
Reference in new issue
Block a user