Breaks slow query warnings, but most people just set the number higher
once they get warnings anyway.
Also fixes some issues:
- profile duration formatting and time (sec to ms).
- incorrect log query/param index.
Promises, even when resolved/rejected immediately after their creation, will
destroy any useful information from a stack trace when used over
events/exports.
Since some people still use the exports rather than MySQL/lib.lua, and for
some reason don't know the correct syntax for Lua exports (i.e. using
exports.oxmysql.query instead of the CORRECT exports.oxmysql:query) it's
comically common for an "untraceable" error to get spit out.
Will this help? No. Will everyone expect me to solve their issues? Yes.
Go update your scripts to use MySQL/lib.lua and we can all get along
stress-free.
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.
oxmysql is unexpectedly catching errors thrown by the Lua runtime
when an error occurs during a function reference.
This lead to an 'undefined' error being thrown, specifically when
yielding a thread during the function reference.
Not really an oxmysql bug, so this should just be a temporary workaround.
Only allow manual error handling when using the await/sync methods,
or when calling the default exports.
Async/Callback returns need to throw errors for compatibility.
Add boolean to disable throwing error for query.
Reject promises when using _async exports.
Return errors as strings instead of Error (fails to serialise).
Fixes#122
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.
Parse each value while iterating prepared statements, ensuring
objects are remapped to arrays and NULL values are properly
inserted.
Utilise transactions to rollback changes in the event of an error.
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.