store users login
This commit is contained in:
34
scratch/query_stores.js
Normal file
34
scratch/query_stores.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const { Client } = require('pg');
|
||||
|
||||
const client = new Client({
|
||||
host: '66.116.207.225',
|
||||
port: 5433,
|
||||
database: 'nearledb',
|
||||
user: 'admin',
|
||||
password: 'Package@123#',
|
||||
ssl: false,
|
||||
});
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
await client.connect();
|
||||
console.log('Connected to PostgreSQL successfully!');
|
||||
|
||||
// Get Suriya Store locations
|
||||
const locationsRes = await client.query('SELECT locationid, tenantid, locationname, email, contactno, status FROM tenantlocations WHERE tenantid = 1135');
|
||||
console.log('\n--- SURIYA STORE LOCATIONS (tenantid = 1135) ---');
|
||||
console.table(locationsRes.rows);
|
||||
|
||||
// Get all users associated with tenantid = 1135
|
||||
const usersRes = await client.query('SELECT userid, authname, firstname, email, contactno, roleid, locationid, status FROM app_users WHERE tenantid = 1135');
|
||||
console.log('\n--- USERS ASSOCIATED WITH tenantid = 1135 ---');
|
||||
console.table(usersRes.rows);
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error connecting:', err);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user