Commit Graph
190 Commits
Author SHA1 Message Date
Luke 2fc0aa4de9 fix(nui): Don't throw failed to fetch error in browser 2022-01-01 13:21:17 +01:00
Luke 4529361e92 feat(nui): Generate resource list from client data 2021-12-31 16:59:39 +01:00
Luke 110cf81213 feat(nui): Entry animation 2021-12-31 16:21:07 +01:00
Luke 33969f57b0 fix(client): Set visibility and focus 2021-12-31 15:15:25 +01:00
Luke c8857e18c4 fix(nui): Visibility setting and building 2021-12-31 15:10:45 +01:00
Luke d1a5a9e249 tweak(nui): Alignment 2021-12-31 15:10:10 +01:00
Luke 8a45f430fc chore(nui): Rename some exported components 2021-12-31 14:09:35 +01:00
Luke bee8f5881a fix(nui): Main content wrapper 2021-12-31 00:38:53 +01:00
Luke 6493762795 feat(nui): Content container, right nav bar 2021-12-31 00:29:25 +01:00
dunak-debug e3b145bcbd feat(ui): Add react-router 2021-12-30 23:39:49 +01:00
Luke b2b1a64c8f chore(nui): WIP React rewrite 2021-12-30 20:05:07 +01:00
Luke ce802e7553 feat(ui): Setting resource list from NUI message 2021-12-28 01:48:34 +01:00
Luke 49bf5bb3ce fix(ui): Don't display failed fetches in browser 2021-12-28 00:42:45 +01:00
Luke 5eaed9f87b feat(ui): Query data fetching 2021-12-28 00:37:23 +01:00
DunakandLinden 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
dunak-debug 0290ea17e3 feat(ui): Client-side wrapper 2021-12-27 12:59:14 +01:00
Luke 8fb5ca2e8c fix: Initialize resource array before using it 2021-12-26 21:34:29 +01:00
Luke b0f25778fd fix: Set correct fxmanifest bundle.js path 2021-12-26 20:35:22 +01:00
Luke 7ac6de6b26 refactor: Use store to set current resource 2021-12-26 15:41:43 +01:00
Luke 023023555a feat: SPA router 2021-12-26 15:41:43 +01:00
Luke de01f5d5e7 feat: Initial UI design 2021-12-26 15:41:43 +01:00
Luke 5bbf30e4b4 feat: Initial UI files 2021-12-26 15:41:43 +01:00
dunak-debug 4498dddbac WIP: Rewrite to TS & Cleanup 2021-12-26 02:21:46 +01:00
Linden 893b802029 fix(lib): set correct alias for execute
MySQL-async syntax was calling the execute export rather than update.
v1.9.0
2021-12-25 04:10:09 +11:00
Linden 9b8d6d6c56 update release workflows 2021-12-25 01:58:04 +11:00
Linden 00bfcd35cc Relicense from GPL to LGPL
Since lib/MySQL is loaded into a resource as a module, it would technically require any resources linking to oxmysql to be licensed under GPLv3.
LGPL exists to provide this exception when dynamically linking modules.
2021-12-24 19:31:46 +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 f9c33be0fe refactor: rename exports
Removes _callback suffix from exports and bring some exports out of deprecation (single, scalar, etc).

"Sync" exports still use _async.
2021-12-24 03:08:06 +11:00
Linden 452d1ad5ee fix(execute): incorrect queryCount when sending single array
An array containing parameters, rather than arrays, is always a single query.
2021-12-23 19:50:21 +11:00
Linden 0537519c8a chore: update readme info and include some sample queries 2021-12-23 15:21:14 +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 e5c5fc3b1b refactor(execute): split into execute and query
query refers to the old execute function.
preparedStatement renamed to execute.

Parse arguments before establishing connection.
Utilise response function to determine and return correct values to the export.

execute now accepts an array of values when performing a single query, rather than requiring an array within an array.
2021-12-23 13:56:31 +11:00
Linden 860af3ff14 refactor(transaction): parse arguments prior to establishing connection
Rather then acquiring a connection, throwing an error, then closing the connection.
2021-12-23 13:51:20 +11:00
Linden 0afb32858d refactor(utils): rename parser and add additional functions
Create a handler for ScheduleResourceTick.
Handle serverReady function and isReady state.

Rewrite parameter parser to wrap all export arguments, ensure parameter and callbacks, and improve placeholder resolution.

Setup a response function to handle export return values.
2021-12-23 13:47:25 +11:00
Linden f5e25e3574 refactor(config): moved typeCast function into config 2021-12-23 13:42:12 +11:00
Linden 35f198f2b5 refactor(pool): cleanup connection options and createPool defaults
Additionally perform initial database connection as part of this module, rather than index.
2021-12-23 13:40:54 +11:00
Linden 17c4916010 refactor: replace webpack with esbuild 2021-12-23 13:35:43 +11:00
Linden b7a17d9566 refactor(patches): remove redundant code
mysql2 calls some code, namely _resolveNamedPlaceholders, that is handled by oxmysql before the query is executed.

Other changes:
Calculate query execution time as part of the Query command.
Check for undefined parameters during placeholder resolution.
2021-12-23 13:29:29 +11:00
Linden 4e29905179 fix(execute): check resourcestate is 'started' to resolve promise v1.8.7 2021-12-10 10:55:27 +00:00
Linden 78ce45f1de refactor(patch/named-placeholders): performance tweaks
Little bit of micro-optimisation to increase speed of placeholder resolution by 2x
v1.8.6
2021-12-10 11:19:27 +11:00
Linden 193da3e6c7 refactor(execute): execute queries after first tick
Force queries to wait until the server has ticked before sending anything.
2021-12-10 11:18:15 +11:00
Linden cd2e73953f test: re-enable slow query warnings 2021-12-10 11:17:02 +11:00
Linden 3928415930 test: revert recent changes
People are experiencing errors that I've been unable to reproduce, but 1.8.3 apparently works fine.
Revert changes that were made.

This disables slow query warnings for now.
2021-12-08 07:43:25 +11:00
Linden b27662d138 Update issue templates 2021-12-07 10:58:27 +11:00