Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit d34bbc4

Browse files
committed
fix(execute): properly await all query responses
1 parent 920252f commit d34bbc4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ game 'common'
33

44
name 'oxmysql'
55
description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
6-
version '2.2.0'
6+
version '2.2.1'
77
url 'https://github.com/overextended/oxmysql'
88
author 'overextended'
99

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oxmysql",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "FXServer to MySQL communication via node-mysql2",
55
"repository": "git@github.com:overextended/oxmysql.git",
66
"author": "dunak-debug <19434539+dunak-debug@users.noreply.github.com>",

src/database/rawExecute.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,18 @@ export const rawExecute = async (
3030

3131
await connection.beginTransaction();
3232

33-
parameters.forEach(async (values: any) => {
33+
for (let values of parameters as CFXParameters[]) {
3434
values = parseValues(placeholders, values);
3535
const [rows] = (await connection.execute(query, values)) as RowDataPacket[][];
36+
3637
if (rows.length > 1) {
3738
for (const row of rows) {
3839
results.push(parseResponse(type, row));
3940
}
4041
} else results.push(parseResponse(type, rows));
4142

4243
logQuery(invokingResource, query, process.hrtime(executionTime)[1] / 1e6, values as typeof parameters);
43-
});
44+
}
4445

4546
response = results;
4647

0 commit comments

Comments
 (0)