diff --git a/fxmanifest.lua b/fxmanifest.lua index e696334..e7b6a00 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -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' diff --git a/package.json b/package.json index bffd8cd..7976263 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oxmysql", - "version": "2.2.0", + "version": "2.2.1", "description": "FXServer to MySQL communication via node-mysql2", "repository": "git@github.com:overextended/oxmysql.git", "author": "dunak-debug <19434539+dunak-debug@users.noreply.github.com>", diff --git a/src/database/rawExecute.ts b/src/database/rawExecute.ts index 91e3fa4..0a0616b 100644 --- a/src/database/rawExecute.ts +++ b/src/database/rawExecute.ts @@ -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;