You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i call await execSQLFC(sql); then the problem occurs.
if i add await connection.query(USE ${process.env.SQL_FCDB}); it will working.
my configure (something wrong?):
constexecSQLFC=async(sql,values)=>{letconnection;try{connection=awaitpoolCluster.getConnection('FloorcareDB');awaitconnection.query(`USE ${process.env.SQL_FCDB}`);console.log('Connected to FloorcareDB');const[dbCheck]=awaitconnection.query('SELECT DATABASE() as currentDB');console.log('Current database:',dbCheck[0].currentDB);console.log('FloorcareDB');const[rows]=awaitconnection.query(sql,values);connection.release();returnrows;}catch(err){if(connection)connection.release();console.error(err);returnerr;}};constexecSQLTrace=async(sql,values)=>{letconnection;try{connection=awaitpoolCluster.getConnection('TraceDB');awaitconnection.query(`USE ${process.env.SQL_TRACEDB}`);console.log('Connected to TraceDB');const[dbCheck]=awaitconnection.query('SELECT DATABASE() as currentDB');console.log('Current database:',dbCheck[0].currentDB);const[rows]=awaitconnection.query(sql,values);connection.release();returnrows;}catch(err){if(connection)connection.release();console.error(err);returnerr;}};module.exports={ execSQLFC, execSQLTrace };
The text was updated successfully, but these errors were encountered:
when i call await execSQLFC(sql); then the problem occurs.
if i add await connection.query(
USE ${process.env.SQL_FCDB}
); it will working.my configure (something wrong?):
****DBConfig.js
ExecuteSQL.js
The text was updated successfully, but these errors were encountered: