mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 06:28:54 +00:00
refactor(database): use setCallback
This commit is contained in:
1 parent
bcb703a11f
commit
f3e9aa52d9
3 files changed
+11
-4
No files matched your search
@@ -5,6 +5,7 @@ import { parseResponse } from '../utils/parseResponse';
|
||||
import { executeType, parseExecute } from '../utils/parseExecute';
|
||||
import { scheduleTick } from '../utils/scheduleTick';
|
||||
import { isServerConnected, waitForConnection } from '../database';
|
||||
import { setCallback } from '../utils/setCallback'
|
||||
|
||||
export const rawExecute = async (
|
||||
invokingResource: string,
|
||||
@@ -25,7 +26,9 @@ export const rawExecute = async (
|
||||
|
||||
const type = executeType(query);
|
||||
const placeholders = query.split('?').length - 1;
|
||||
parameters = parameters ? parseExecute(placeholders, parameters) : [];
|
||||
|
||||
cb = setCallback(parameters, cb);
|
||||
parameters = parseExecute(placeholders, parameters);
|
||||
|
||||
if (!isServerConnected) await waitForConnection();
|
||||
|
||||
|
||||
Reference in new issue
Block a user