Commit Graph
125 Commits
Author SHA1 Message Date
Linden 12e9ccbc8a feat(lua): update http link and version checking v1.7.1 2021-10-31 08:32:27 +11:00
Linden 2a9b14ce54 chore(lua): update fxmanifest version 2021-10-31 07:18:55 +11:00
Linden f7949db0d3 chore(workflow): update run tasks 2021-10-31 07:17:45 +11:00
Linden 2a14ab1e21 refactor(webpack): update patterns and do not minify 2021-10-31 06:48:30 +11:00
Linden 9de50f684f refactor(lua): remove file check and move to subdirectory 2021-10-31 06:48:00 +11:00
Linden 2c90290c84 fix(wrapper): check if oxmysql.js exists via io function 2021-10-29 09:26:01 +11:00
Linden 9fc06c2132 refactor(versioncheck): remove module and perform check with Lua
Unnecessary dependency with functionality that can be easily handled via PerformHttpRequest.

Since the check references fxmanifest instead, we will no longer maintain the version in package.json.
2021-10-29 08:14:39 +11:00
Linden def891268b feat(wrapper): throw an error when no build exists
Many people refuse to download releases, instead opting for the source code. Throw an error and include a link to the direct download.
2021-10-29 07:08:36 +11:00
Dunak 8a3fa20408 fix(pool): Remove default database value from config 2021-10-25 10:55:42 +02:00
Dunak 5d6ca06f49 fix(parser): Check if query is string type not undefined
- Should fix issues when exports is wrong called with `.` instead of `:`
2021-10-24 14:56:38 +02:00
Linden 4913d6e50a chore: Version bump v1.7.0 2021-10-24 02:15:10 +11:00
Linden ca8cef4e26 refactor(prepare): Rename prepared export to prepare 2021-10-24 02:13:55 +11:00
Linden 2a8f4b1ea9 feat: Add an export to call prepared statements (#54)
* feat: Add an export to call prepared queries

- Utilises pool.execute (rather than query) to actually prepare parameters through mysql.

This is intended for appropriately built queries utilising  placeholders and parameters, and should only be used on frequently repeated queries.

* refactor(prepare): Clean up results and add total execution time

* feat(prepare): Send scalar response for a single value

* fix(prepare): Check if result exists before getting keys
2021-10-23 09:05:01 +11:00
Linden 1d0a5bcfd9 Update issue templates 2021-10-23 08:55:54 +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 f7ed2d5b60 chore: Bump version v1.6.3 2021-10-19 04:41:55 +11:00
Linden ec9d787be4 fix: Resolve null length on some queries
- Ensure parameters when checking length, and update dependencies for mysql2 patch
2021-10-19 04:26:08 +11:00
Linden abf259543d chore: Update version and dependencies v1.6.2 2021-10-18 02:19:09 +11:00
Linden 9d8a29388c fix(parser): Only assign null values if placeholders were found 2021-10-18 01:52:22 +11:00
Linden 00f9d0449c fix(regex): Prevent converting JSON in queries into placeholders
- When a JSON string is entered as part of a query, rather than a parameter, it is assumed to define a named placeholder - this will check for quotations and ignore it
2021-10-18 01:51:37 +11:00
Linden a46b586832 Merge pull request #51 from darksaid98/main
fix(parse): Resolve nil parameters when using `['@key'] = val`
2021-10-17 04:16:04 +11:00
darksaid98 dc50fe6dbb style: rename paramName variable 2021-10-16 19:11:09 +02:00
darksaid98 a6d483ca48 fix: nil parameters with named placeholders
- Fixes the remaining edge-case bug with passing nil parameters
2021-10-16 19:05:57 +02:00
Linden b1babdbc09 chore: Update version v1.6.1 2021-10-17 02:04:09 +11:00
Linden f8f97344fd Merge pull request #50 from darksaid98/varatstart
fix: Parameter keys beginning with ':' & '@'
2021-10-17 01:58:24 +11:00
darksaid98 48ee030372 fix: parameter keys beginning with : & @ 2021-10-16 16:02:43 +02:00
Linden fe1d6e6b05 fix(config): Reset colour after version check message v1.6.0 2021-10-16 10:46:29 +11:00
Linden c1f5bb3375 chore: Version bump 2021-10-16 10:43:27 +11:00
Linden d4e367baaf fix(lib): Allow transactions to utilise safeArgs function
- Also updates luadocs
2021-10-16 10:24:00 +11:00
Linden ce87bc488c fix(parser): Allow queries with multiple placeholders and no parameters
- '...?, ?, ?', {nil, nil, nil} will set all placeholders to null
2021-10-16 10:20:35 +11:00
Linden dc55401b78 fix: Return boolean for TINYINT 2021-10-16 10:20:35 +11:00
Linden 3b55e890a8 fix: Display correct query execution time 2021-10-16 10:20:35 +11:00
Linden bacd9c171d chore: Point mysql2 dependency to fork
I'd like some control over incoming changes to fit our use-case, and patch-package doesn't quite fulfil our needs.
2021-10-16 10:20:35 +11:00
Linden 29d28197bb chore: Version bump dependencies 2021-10-16 10:20:35 +11:00
Linden 4646c6f027 fix: Assign object entries to array
Assigning the entries to an array first permits comparing the lengths and setting undefined entries as null
2021-10-16 10:20:35 +11:00
Linden 30a391031b fix: Resolve error when parameter length does not match
- Throws a more specific error when receiving mismatch for column and value counts

- Resolves error when final parameter is nil
2021-10-16 10:20:35 +11:00
Linden 22de50c081 Apply mysql2 patch
- Remove extra _resolveNamedPlaceholders call from query

- Apply several patches by github/testn (pending merge); refer to pull requests #1408, #1402, #1401, #1400

- Optimise query.row call
- Cache lazy-evaluated field
- Optimise string decoding
- Avoid leaking TextRow/BinaryRow
2021-10-16 10:20:35 +11:00
Linden d0730c5e9b feat: Add support for nil parameters
- Throws an error if no params are defined when using named parameters, otherwise seems okay
2021-10-16 10:20:35 +11:00
Linden b781f0ca45 feat(lib): Setup support for lua docs 2021-10-15 18:41:17 +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 de2c731295 chore: Update comments for function return values 2021-10-08 15:58:11 +11:00
H@merandLinden 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]>
v1.5.1
2021-10-08 14:00:47 +11:00
Linden 1266f4a7b6 chore: Update dependencies and version bump 2021-10-08 11:17:50 +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 5b55c81046 chore: Update readme 2021-10-08 05:47:34 +11:00
dunak-debug 6acd0ac352 chore: Bump to 1.5.0 v1.5.0 2021-10-06 23:52:38 +02:00
Dunak 55d8d46334 feat(ci): Include mysql-async compat library 2021-10-06 22:59:46 +02: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
Linden 1ec52903ca feat: Add support for semicolon connection strings 2021-10-07 06:26:07 +11:00
Linden 7e5d4cce06 chore: Version bump and set to production v1.4.1 2021-09-27 10:13:36 +10:00