Commit Graph
52 Commits
Author SHA1 Message Date
Linden d80615bddc fix(db): handle errors during callbacks
Handles errors that would previously disappear into the void or show as 'undefined'.

In Lua this would only occur if yielding during the query callback response.

Cross runtime error handling is suffering.
2022-06-26 04:02:50 +10:00
Linden 15884fbc82 refactor: error handling
Meant to push this before release.
Ensures errors are handled as before, regardless of using exports
or lib/mysql; for compatibility.
2022-06-18 16:32:07 +10:00
Linden a709f67e99 chore: version bump 2022-06-18 14:19:50 +10:00
Linden 2e751a3537 chore: version bump 2022-05-16 04:46:26 +10:00
Linden fda3cab3b5 chore: version bump 2022-04-30 04:14:28 +10:00
Linden 050eef58b9 fix(execute): revert to promise api
Several reports of increased chances to hit a deadlock since v2.2.2, and
three reports of a timeout during prepare since v2.2.4.
Simpler to revert to the old prepare function and api (with improvements)
than to work out the solution.

Look into rewriting prepare in the future or including the mariadb connector,
which doesn't suffer from the same perf issues.
2022-04-03 06:10:13 +11:00
Linden fa1cdcc668 fix(execute): incorrect response parsing
Fixes several regressions and issues from ef0dfaa.
Sending a single parameter would set 'single' to true, ignoring multiple
results from the database and returning 'null'.
SELECT should not trigger transactions, not the other way around.
Results should not be parsed when no callback is defined.
2022-04-03 03:52:07 +11:00
Linden 9511af734b chore: update version 2022-04-03 01:27:51 +11:00
Linden c9e402ccdc fix(query): less verbose errors 2022-04-02 01:37:56 +11:00
Linden d34bbc45f5 fix(execute): properly await all query responses 2022-03-26 00:58:27 +11:00
Linden d45e98f38e chore: update version and workflows 2022-03-25 19:01:06 +11: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 98b4f108e8 chore: update dependencies and commit lint 2022-03-03 00:04:27 +11:00
Linden 6d96c1104b refactor(db): Delay connection until first tick 2022-02-28 16:00:30 +11:00
Linden 2d28c447ec fix(db/rawExecute): Parse multiple returned rows 2022-02-24 10:59:12 +11:00
Linden b2ca6b0c66 chore: Update version 2022-02-19 10:07:19 +11:00
Linden 0d64cb8cfe chore: Update version refs to 2.0.0 2022-02-19 03:55:12 +11:00
Luke 4e027c18fe chore: Bump version to 1.9.3 2022-02-14 16:42:51 +01:00
Linden 2ea78f1b1b Merge branch 'refactor' into main 2022-02-14 22:23:28 +11:00
Linden 0eb6e9c72c chore(fxmanifest): add convar_category
Improve support when using FxDK, allowing convars to be set in the project settings window.
2022-01-11 16:13:33 +11:00
Luke b2b1a64c8f chore(nui): WIP React rewrite 2021-12-30 20:05:07 +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 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 b0f25778fd fix: Set correct fxmanifest bundle.js path 2021-12-26 20:35:22 +01:00
Luke 5bbf30e4b4 feat: Initial UI files 2021-12-26 15:41:43 +01: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 9de50f684f refactor(lua): remove file check and move to subdirectory 2021-10-31 06:48:00 +11:00
Linden 4913d6e50a chore: Version bump 2021-10-24 02:15:10 +11:00
Linden f7ed2d5b60 chore: Bump version 2021-10-19 04:41:55 +11:00
Linden abf259543d chore: Update version and dependencies 2021-10-18 02:19:09 +11:00
Linden b1babdbc09 chore: Update version 2021-10-17 02:04:09 +11:00
Linden c1f5bb3375 chore: Version bump 2021-10-16 10:43:27 +11:00
Linden 31959beb85 fix(manifest): Disable server_only
- Until dependencies can be used for server only resources, disable this to prevent clients failing to load.
2021-10-11 03:22:55 +11:00
Linden a06cf65d10 feat(lib): safeArguments function to assert types
- Ensures each argument has the expected type
- Refactor each function for reduced code duplication
- Correctly check Store for number queries (Async functions did not retrieve string)
2021-10-08 05:51:07 +11:00
dunak-debug 6acd0ac352 chore: Bump to 1.5.0 2021-10-06 23:52:38 +02:00
Linden 7e5d4cce06 chore: Version bump and set to production 2021-09-27 10:13:36 +10:00
dunak-debug 372a95632c refactor: Transaction tweaks and version bump 1.4.0 2021-09-20 17:32:58 +02:00
dunak-debug 5e89d62688 chore: Bump version to 1.3.5
- Removed unused ts-loader
2021-09-20 13:45:55 +02:00
BerkieBb 076e327c9a feat: Change game to common to enable support for other game like rdr3 2021-09-19 20:41:30 +02:00
Linden c5f150e003 improvement: Only display warnings if callback is defined
- Non-function callbacks will display a warning.
- This makes the third argument optional for async queries.
2021-09-19 04:25:42 +10:00
dunak-debug 4b2b564591 chore: Bump version to 1.3.2 2021-09-18 12:45:37 +02:00
Linden be221b70d3 feat: Enable JS sync exports if wrapper.lua is not loaded 2021-09-18 10:28:40 +10:00
Linden b01e30d7b1 feat: New js sync exports (disabled by default)
New exports are faster than the lua wrapper and should be used to replace them

- Require a recent non-recommended server artifact
- If enabled, wrapper.lua should be removed

Lua 5.4 is enabled for improved memory and garbage collection when using the old wrapper
2021-09-17 06:30:58 +10:00
dunak-debug e09b3482ba chore: bump version to 1.2.0 2021-09-12 18:09:37 +02:00
dunak-debug 93d86f849a chore: bump version to 1.1.0 2021-09-11 03:40:23 +02:00
darksaid98 8be251382d feat(fxmanifest): set server_only
- Since the script only runs on the server there is no need for clients to be aware of it's existance
2021-09-09 15:28:34 +02:00
dunak-debug ce0d35fcf2 chore(version): setup first release 0.1.0 2021-08-17 16:50:25 +02:00
dunak-debug 8df05c748b refactor: remove typescript and refactor 2021-08-17 02:58:31 +02:00