feat: add pg-ff-client to replace HTTP API calls with bulk PostgreSQL queries

This commit is contained in:
Michael committed 2026-04-23 10:36:37 +02:00
1 parent 32c1e06782
commit bd8339b27d
3 files changed
+62 -5

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
require('dotenv').config({ path: 'c:/GIT/CollectFlow/.env.local' });
const { Pool } = require('pg');
async function test() {
const pool = new Pool({
connectionString: process.env.DATABASE_URL
});
try {
const res = await pool.query("SELECT * FROM cube_stock WHERE cs.site = '292' LIMIT 5");
console.log("CUBE_STOCK:", res.rows);
} catch(e) {
console.log("ERROR cube_stock:", e.message);
}
try {
const res2 = await pool.query("SELECT a.codein, a.no_id FROM articles a LIMIT 5");
console.log("ARTICLES:", res2.rows);
} catch(e) {
console.log("ERROR articles:", e.message);
}
pool.end();
}
test();