Commit Graph
113 Commits
Author SHA1 Message Date
Linden 86d85dfa00 fix(execute): handle nil parameters in prepared statements
Lua tables are msgpacked with the 'without_hole' setting, resulting
in an object. rawQuery already handles this and converts an object
into an array (filling null where appropriate).

Give rawExecute the same treatment.
2022-03-25 04:41:39 +00:00
Cuchi 4417b728fa feat(logger/command): Warning message when mysql command is run from server (#97) 2022-03-18 17:25:03 +01:00
Linden afc04fc553 fix(db): move query responses to their own try block
Other resources with script errors (notably "attempt to index a nil value") would mistakenly report the query as failed, and people would assume ANY reported errors were because of oxmysql, even through it was their own awful script.

No errors should be thrown in oxmysql when an error occurs in a function reference.
2022-03-07 15:13:07 +11:00
Linden 4bbbe1efc2 refactor(index): cease resistance against 0 iq fivem community
Why did I think maintaining this type of resource would be a good idea?
2022-03-03 19:51:00 +11:00
Linden cd62fdd904 refactor(utils/parseArguments): Reduce redundant assignments
More in-line with 1.9.3 parser; reduced garbage and improved performance. Should handle JSON better.
2022-03-02 23:24:52 +11:00
Linden 895d08ef0f fix(db): Define pool type 2022-03-02 22:56:47 +11:00
Linden e0a2a41870 fix(db/rawTransaction): Await scheduleTick 2022-03-02 22:56:07 +11:00
Linden 9e50d8ddd0 fix(utils/parseArguments): Missing type check 2022-02-28 16:01:08 +11:00
Linden 6d96c1104b refactor(db): Delay connection until first tick 2022-02-28 16:00:30 +11:00
Linden 31d971837d fix(update): Catch errors when fetching GitHub API 2022-02-25 17:23:46 +11:00
Linden ec53b3282d refactor(utils/scheduleTick): Await database connection 2022-02-25 17:11:28 +11:00
Linden 2d28c447ec fix(db/rawExecute): Parse multiple returned rows 2022-02-24 10:59:12 +11:00
Linden e29ca87c98 fix(utils): Do not convert placeholders if query contains JSON 2022-02-24 10:24:27 +11:00
Jaime Filho 8611cc0762 fix: Add charset to cast binary and json data correctly 2022-02-18 19:12:46 -03:00
Linden afbfb21a3d fix(src/update): Remove .zip from release url 2022-02-15 14:56:16 +11:00
Linden 86e51e79ef refactor(update): Use GitHub releases API
Compare current version to latest release.
2022-02-14 22:25:59 +11:00
Linden 2ea78f1b1b Merge branch 'refactor' into main 2022-02-14 22:23:28 +11:00
Luke 21fab4167b Revert "fix(logger): Require command ace permission to open ui"
This reverts commit 9369873481.
2022-02-13 19:26:57 +01:00
Luke 9369873481 fix(logger): Require command ace permission to open ui 2022-02-11 13:03:53 +01:00
Linden 3cfa080cfc fix(utils/typeCast): Ensure field.packet is defined
Apparently this can be undefined.
2022-02-11 05:15:29 +11:00
Linden 7096237ce2 refactor(utils/typeCast): Change BIT and BLOB types
BIT fields should only cast as boolean if they have a length of 1.
2022-02-10 17:23:42 +11:00
Linden 4975a17a31 fix(db/execute): Parse responses during prepare
Prepare should return the most appropriate result type (scalar, single, query, update, etc.)
2022-02-10 16:57:28 +11:00
Luke 553775c9a0 feat(nui): Display the amount of slow queries 2022-02-02 13:55:30 +01:00
Luke b0ea8e1172 feat(nui): Display slow queries with yellow text color 2022-01-27 17:23:45 +01:00
Luke 31fb361c4c feat(nui): Fetch chart data from resources 2022-01-27 12:47:13 +01:00
dunak-debug 2200b0b0f5 chore: Remove logger mock data 2022-01-23 13:22:17 +01:00
erik.balog 38e30c6640 fix: Scalar return value 2022-01-23 13:10:34 +01:00
dunak-debug f89f232b1c feat(ui): Render spinner until data fetched 2022-01-08 14:40:13 +01:00
dunak-debug 3554ba2fc8 feat(ui): Implement sorting function (WIP) 2022-01-08 14:15:17 +01:00
dunak-debug 21ded71fde fix: Return correct scalar value 2022-01-07 23:41:11 +01:00
Luke 238d7cd589 fix(nui): Data fetching into manual pagination
Perhaps don't need the loading state...?
2022-01-04 22:04:13 +01:00
Luke 7560099231 feat(nui): WIP manual pagination 2022-01-04 18:36:52 +01:00
dunak-debug 3a1462e0c0 fix(execute): Parse parameters as intended 2022-01-04 16:10:27 +01:00
dunak-debug af75f140ac fix(config): Throw error when connection string not found 2022-01-01 23:37:59 +01:00
Linden 64fd6249ba fix(utils): convertNamedPlaceholders requires parameters
Resolves unexpected behaviour when resources send concatenated queries containing : and @

i.e. esx_status case query
2021-12-29 04:18:02 +11:00
Linden 47a33bbba7 fix(db): parseArguments during try block
Error catching when unexpected data is passed to query string.
2021-12-29 03:28:16 +11:00
Linden d54bcae363 fix(db): incorrect error reporting failed queries
When using callback functions and throwing an error (i.e. attempt to index a nil value), it would respond about an error in a nested ref call.

Don't catch callback errors.
2021-12-28 18:41:19 +11:00
dunak-debug 0290ea17e3 feat(ui): Client-side wrapper 2021-12-27 12:59:14 +01:00
Luke 8fb5ca2e8c fix: Initialize resource array before using it 2021-12-26 21:34:29 +01:00
Luke 7ac6de6b26 refactor: Use store to set current resource 2021-12-26 15:41:43 +01:00
Luke 023023555a feat: SPA router 2021-12-26 15:41:43 +01:00
Luke de01f5d5e7 feat: Initial UI design 2021-12-26 15:41:43 +01:00
Luke 5bbf30e4b4 feat: Initial UI files 2021-12-26 15:41:43 +01:00
dunak-debug 4498dddbac WIP: Rewrite to TS & Cleanup 2021-12-26 02:21:46 +01:00
Linden f9c33be0fe refactor: rename exports
Removes _callback suffix from exports and bring some exports out of deprecation (single, scalar, etc).

"Sync" exports still use _async.
2021-12-24 03:08:06 +11:00
Linden 452d1ad5ee fix(execute): incorrect queryCount when sending single array
An array containing parameters, rather than arrays, is always a single query.
2021-12-23 19:50:21 +11:00
Linden 36dd8ddd14 refactor: utilise new exports and deprecate old ones
Exports now utilise more accurate names to reflect their behaviour, with less confusion for JS users (await executeSync is no more).

Exports return promises or callback results directly to reduce promise chaining.

Promise exports now fully utilise JS, with Lua being removed from the resource - version checking runs through JS instead.

Various improvements to lib/MySQL as well as introduction of a prepare wrapper.
2021-12-23 14:15:17 +11:00
Linden e5c5fc3b1b refactor(execute): split into execute and query
query refers to the old execute function.
preparedStatement renamed to execute.

Parse arguments before establishing connection.
Utilise response function to determine and return correct values to the export.

execute now accepts an array of values when performing a single query, rather than requiring an array within an array.
2021-12-23 13:56:31 +11:00
Linden 860af3ff14 refactor(transaction): parse arguments prior to establishing connection
Rather then acquiring a connection, throwing an error, then closing the connection.
2021-12-23 13:51:20 +11:00
Linden 0afb32858d refactor(utils): rename parser and add additional functions
Create a handler for ScheduleResourceTick.
Handle serverReady function and isReady state.

Rewrite parameter parser to wrap all export arguments, ensure parameter and callbacks, and improve placeholder resolution.

Setup a response function to handle export return values.
2021-12-23 13:47:25 +11:00