mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-11 17:26:32 +02:00
26 lines
690 B
JavaScript
26 lines
690 B
JavaScript
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();
|