new file: backend/check_endpoints.js
modified: backend/src/services/SqlExecutor.ts
This commit is contained in:
33
backend/check_endpoints.js
Normal file
33
backend/check_endpoints.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
const { Client } = require('pg');
|
||||||
|
|
||||||
|
async function checkEndpoints() {
|
||||||
|
const client = new Client({
|
||||||
|
host: '192.168.0.150',
|
||||||
|
port: 5432,
|
||||||
|
database: 'kis_api_builder_db',
|
||||||
|
user: 'kis_api_builder',
|
||||||
|
password: 'kis_api_builder_pass'
|
||||||
|
});
|
||||||
|
|
||||||
|
await client.connect();
|
||||||
|
|
||||||
|
const query = `
|
||||||
|
SELECT
|
||||||
|
e.path,
|
||||||
|
e.script_queries::text as script_queries
|
||||||
|
FROM endpoints e
|
||||||
|
WHERE e.path IN ('/hosp/updateHospData', '/apitesttest')
|
||||||
|
`;
|
||||||
|
|
||||||
|
const result = await client.query(query);
|
||||||
|
|
||||||
|
for (const row of result.rows) {
|
||||||
|
console.log('\n========================================');
|
||||||
|
console.log('PATH:', row.path);
|
||||||
|
console.log('SCRIPT_QUERIES:', row.script_queries);
|
||||||
|
}
|
||||||
|
|
||||||
|
await client.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkEndpoints().catch(console.error);
|
||||||
@@ -47,7 +47,8 @@ export class SqlExecutor {
|
|||||||
this.validateQuery(sqlQuery);
|
this.validateQuery(sqlQuery);
|
||||||
|
|
||||||
// Log SQL query and parameters before execution
|
// Log SQL query and parameters before execution
|
||||||
console.log('\n[SQL Query]', sqlQuery);
|
console.log('\n[SQL DB]', databaseId);
|
||||||
|
console.log('[SQL Query]', sqlQuery);
|
||||||
console.log('[SQL Params]', params);
|
console.log('[SQL Params]', params);
|
||||||
|
|
||||||
// Execute with retry mechanism
|
// Execute with retry mechanism
|
||||||
|
|||||||
Reference in New Issue
Block a user