mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
fix(execute): properly await all query responses
This commit is contained in:
1 parent
920252f138
commit
d34bbc45f5
3 files changed
+5
-4
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ game 'common'
|
||||
|
||||
name 'oxmysql'
|
||||
description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
|
||||
version '2.2.0'
|
||||
version '2.2.1'
|
||||
url 'https://github.com/overextended/oxmysql'
|
||||
author 'overextended'
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "oxmysql",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"description": "FXServer to MySQL communication via node-mysql2",
|
||||
"repository": "[email protected]:overextended/oxmysql.git",
|
||||
"author": "dunak-debug <[email protected]>",
|
||||
|
||||
@@ -30,9 +30,10 @@ export const rawExecute = async (
|
||||
|
||||
await connection.beginTransaction();
|
||||
|
||||
parameters.forEach(async (values: any) => {
|
||||
for (let values of parameters as CFXParameters[]) {
|
||||
values = parseValues(placeholders, values);
|
||||
const [rows] = (await connection.execute(query, values)) as RowDataPacket[][];
|
||||
|
||||
if (rows.length > 1) {
|
||||
for (const row of rows) {
|
||||
results.push(parseResponse(type, row));
|
||||
@@ -40,7 +41,7 @@ export const rawExecute = async (
|
||||
} else results.push(parseResponse(type, rows));
|
||||
|
||||
logQuery(invokingResource, query, process.hrtime(executionTime)[1] / 1e6, values as typeof parameters);
|
||||
});
|
||||
}
|
||||
|
||||
response = results;
|
||||
|
||||
|
||||
Reference in new issue
Block a user