mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 22:22:50 +00:00
refactor(execute): execute queries after first tick
Force queries to wait until the server has ticked before sending anything.
This commit is contained in:
1 parent
cd2e73953f
commit
193da3e6c7
2 files changed
+24
-12
No files matched your search
+1
-11
@@ -1,16 +1,6 @@
|
||||
import { pool } from './pool';
|
||||
import { execute, preparedStatement } from './execute';
|
||||
import { transaction } from './transaction';
|
||||
import { debug, isolationLevel } from './config';
|
||||
|
||||
setImmediate(async () => {
|
||||
try {
|
||||
await pool.query(isolationLevel);
|
||||
console.log(`^2Database server connection established!^0`);
|
||||
} catch (error) {
|
||||
console.log(`^3Unable to establish a connection to the database! [${error.code}]\n${error.message}^0`);
|
||||
}
|
||||
});
|
||||
import { debug } from './config';
|
||||
|
||||
const safeCallback = (callback, result) => {
|
||||
if (typeof callback === 'function') callback(result);
|
||||
|
||||
Reference in new issue
Block a user