mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-11 17:26:32 +02:00
feat: add pg-ff-client to replace HTTP API calls with bulk PostgreSQL queries
This commit is contained in:
1 parent
32c1e06782
commit
bd8339b27d
3 files changed
+62
-5
No files matched your search
@@ -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();
|
||||
Reference in new issue
Block a user