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