Linden
e1b0ff7299
fix(lib/lua): missing rawExecute.await
...
Resolves #185 .
2023-06-20 08:05:35 +10:00
Linden
9a990ca4bd
chore(lib): bump package version
2023-06-18 05:05:56 +10:00
Linden
c97a07a377
feat: isReady and awaitConnection exports
2023-06-13 02:42:54 +10:00
Linden
2ad0539107
refactor(lib/lua): reorganise and rewrite function factory
2023-06-13 02:18:19 +10:00
Linden
e8f1abcab7
feat(rawExecute): "prepare" alternative without unpacking
...
See #179 . Always return an array of row results (or null).
Parameters are now optional (though preferred).
2023-06-06 14:37:05 +10:00
Linden
b772cd2bd2
chore: update dependencies
...
Include last changes for node package.
2023-03-07 02:13:49 +11:00
Linden
61d78dc893
chore(lib): typos
2023-01-28 16:30:35 +11:00
Linden
c292cb44b0
refactor(lib/define): improve Lua types
2022-10-12 18:35:01 +11:00
Linden
1477812b38
refactor(lib/lua): improve definitions
...
Improve return types and support callbacks.
2022-07-12 14:23:39 +10:00
Linden
1b8bf6a081
refactor(lib/lua): safeargs type checks and cb reassignment
2022-07-12 13:33:53 +10:00
Luke
3e1426a859
chore(lib): bump package version
...
for whatever reason 1.1.0 had an older version of the js file
2022-07-11 19:30:24 +02:00
Linden
31212e0198
refactor(lib/ts): improve typing and methods
2022-07-12 00:47:06 +10:00
Luke
e982bd7f89
feat(lib): readme for npm package
2022-07-10 21:49:33 +02:00
Luke
91985638e2
feat: oxmysql exports wrapper as node package
...
https://www.npmjs.com/package/@overextended/oxmysql
2022-07-10 17:14:16 +02: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
bccd6a1035
fix: error handling when using callbacks
...
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.
2022-06-17 21:40:27 +10:00
Linden
7496cf0400
feat(lib): handle errors inside invoking resource
...
Make the source of the error more apparent.
2022-06-04 14:54:20 +10:00
Linden
57bf223a7d
refactor(lib/lua): safeArgs error messages
2022-04-18 23:08:59 +10:00
Linden
b6f850dbd6
Revert "refactor(lib/MySQL): use coroutine instead of promise"
...
This reverts commit 7582973e4e .
Calling coroutine.yield causes issues with the Lua scrt's scheduling. Notably, calling Citizen.Wait will result in the thread never being resumed.
2022-03-23 03:35:05 +11:00
Linden
7582973e4e
refactor(lib/MySQL): use coroutine instead of promise
...
Less overhead and garbage.
2022-03-19 16:51:14 +11:00
Linden
18eb6d1f29
feat(lib): Lua Language Server library definitions
2022-01-29 23:40:37 +11:00
Dunak and Linden
7b88fd4779
fix(lib): accept cb.__cfx_functionReference during safeArgs ( #80 )
...
Co-authored-by: Linden <[email protected] >
2021-12-27 23:18:48 +01:00
dunak-debug
f6b68037c2
feat(lib): Introduce wrapper for typescript
2021-12-27 23:17:22 +01:00
Linden
893b802029
fix(lib): set correct alias for execute
...
MySQL-async syntax was calling the execute export rather than update.
2021-12-25 04:10:09 +11:00
Linden
a12e6d8a94
fix(lib): safeArgs requires transaction for await
2021-12-24 17:37:21 +11:00
Linden
03b94c749f
refactor(lib): MySQL.Sync and MySQL.Async shared __index method
...
Apply the same metatable and create both cb and promise variants when one is called.
Improve assertion error messages.
2021-12-24 17:35:27 +11:00
Dunak
a047e21f51
fix(lib): Pass transaction to safeArgs
2021-12-23 22:37:50 +01:00
Linden
e86bf26221
fix(lib): ensure safeArgs when using __call method
...
This asserts types and checks stored queries when sending a number.
2021-12-24 03:59:39 +11:00
Linden
fc06cab6eb
fix(lib): don't clear alias table
...
I'll fix that up later.
2021-12-24 03:51:18 +11:00
Linden
3fc3cfeecf
feat(lib): setup new export wrappers with mysql-async aliases
...
i.e.
MySQL.Async.fetchAll = MySQL.query
MySQL.Sync.fetchAll = MySQL.query.await
MySQL.Async.fetchScalar = MySQL.scalar
MySQL.Sync.fetchScalar = MySQL.scalar.await
More information in issue #77
2021-12-24 03:31:36 +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
9de50f684f
refactor(lua): remove file check and move to subdirectory
2021-10-31 06:48:00 +11:00
Linden
5965442e48
refactor(lib): Update formatting for improved LDoc usage
...
- This makes it easier to see which function is being defined, but also allows LDocs / Emmy Annotations / whatever to display the full function name.
2021-10-19 08:50:42 +11:00
Linden
d4e367baaf
fix(lib): Allow transactions to utilise safeArgs function
...
- Also updates luadocs
2021-10-16 10:24:00 +11:00
Linden
b781f0ca45
feat(lib): Setup support for lua docs
2021-10-15 18:41:17 +11:00
Linden
de2c731295
chore: Update comments for function return values
2021-10-08 15:58:11 +11:00
H@mer and Linden
93ff6bae45
fix: Incorrect exports used in sync functions for transaction, single, and insert
...
* Fix insert return worng value.
* fix: Use the correct functions for execute/fetchAll
Co-authored-by: Linden <[email protected] >
2021-10-08 14:00:47 +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
Linden
4b179191d4
feat: Imports file for "mysql-async" like usage
...
- Include `server_script '@oxmysql/lib/MySQL.lua'` in the resource manifest
Mostly untested
2021-10-07 07:42:03 +11:00