Initial commit
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
const { Pool } = require('pg');
|
||||
const pool = new Pool({ connectionString: 'postgres://postgres:csh%402018@localhost:5432/ai_pharmacy' });
|
||||
|
||||
pool.query("SELECT * FROM dispensing_records ORDER BY created_at DESC LIMIT 5")
|
||||
.then(res => {
|
||||
console.log('dispensing_records:', res.rows);
|
||||
return pool.query("SELECT * FROM stock_movements ORDER BY created_at DESC LIMIT 5");
|
||||
})
|
||||
.then(res => {
|
||||
console.log('stock_movements:', res.rows);
|
||||
pool.end();
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
pool.end();
|
||||
});
|
||||
Reference in New Issue
Block a user