Releases: brouznouf/fivem-mysql-async
Releases · brouznouf/fivem-mysql-async
3.3.2
Changes
- Removes whitespaces from a legacy connection string.
- Migrated client-side from JS -> LUA for reduced overhead.
- Added a new Server Status display in the UI that gives you hints on optimizing your mysql server (issues should be detected properly, advice might not to be reworked in wording and expanded upon in scope).
Possibilities for future versions I am considering
- Analyze a slow query / table which optimizations would be useful.
- Return values for transactions including if the transaction succeeded or not (still not sure how to implement it).
- Expand the scope of the analysis of the server status.
If you got more ideas, please let me know on discord, cfx:re forums or in the issues for suggestions.
3.3.1
3.3.0
- Uses ghmattimysql now completely, shares almost the complete list of features.
- Enabled js-syntax, which allows nifty shortcuts:
MySQL.Async.fetchAll('SELECT * FROM ?? WHERE ?', {'users', {['id'] = id}})
-- Renders as: SELECT * FROM `users` WHERE `id` = @id; with parameter id being id
- The js-syntax also allows for bulk inserts.
- Switched to typescript.
- Blob field issue has been fixed and now returns arrays.
- Store feature has been added, it is useful for replacing reptitive queries, as the entire query string does not need to be resend to mysql-async
local queryId = MySQL.Sync.store('SELECT * FROM ?? WHERE ?')
--...
MySQL.Async.fetchAll(queryId, {'users', {['id'] = id}}, function(result)
print(json.encode(result))
end)
3.2.3
3.2.2
Changes
- Fixed a possible timeout when resources were loading to slow.
- Added a warning against using MySQL 8, since the performance can be abysmal.
Inserting 1M rows:
### MySQL 5.7 ###
Average: 15.81ms +- 5.81ms
[Min, Max]: [2ms, 119]ms
### Mysql 8.0 ###
Average: 27.14ms +- 66.58ms
[Min, Max]: [3ms, 1323]ms
### MariaDB 10.4 ###
Average: 13.93ms +- 5.20ms
[Min, Max]: [3ms, 151]ms
### MariaDB 10.3 ###
Average: 16.38ms +- 7.85ms
[Min, Max]: [2ms, 200]ms
3.2.1
Changes
- Switch to mysql 2.18.1
- Fixed slow query warnings showing up properly, thanks to @Frosty-Ice
- Added Date + Time for File Logging, from @Neddings
- Updated all packages, frontend switched to Vuetify v2 (what a huge overhead).
- Moved to fxmanifest from __resource.lua, should work with redm.
- Fixed Sync transactions not working properly, thanks to @niekschoemaker
3.2.0
Changes
- Go back to mysql.js 2.15
- Add transactions
- Errors are now always red, unless the debug output is only written to files.
- Use stylus for styling
Transaction examples:
local sqls = { 'UPDATE test_users SET last_name = @ln1 WHERE id = @id1', 'UPDATE test_users SET last_name = @ln2 WHERE id = @id2' }
local params = { id1 = 21, id2 = 22, ['@ln1'] = 'MySQL-Async1', ['@ln2'] = 'MySQL-Async2' }
MySQL.Async.transaction(sqls, params, function(result)
if result then
print('Success1')
else
print('Failure1')
end
end)
local sqls = {
{ query = 'UPDATE test_users SET last_name = @ln1 WHERE id = @id1', parameters = { id1 = 23, ['@ln1'] = 'MySQL-Async3' } },
{ query = 'UPDATE test_users SET last_name = @ln2 WHERE id = @id2', parameters = { id2 = 24, ['@ln2'] = 'MySQL-Async4' } }
}
MySQL.Async.transaction(sqls, function(result)
if result then
print('Success2')
else
print('Failure2')
end
end)
local sqls = {
{ query = 'UPDATE test_users SET last_name = @ln1 WHERE id = @id1', parameters = { id1 = 25, ['@ln1'] = 'MySQL-Async3' } },
{ query = 'UPDATE test_users SET last_name = @ln2 WHERE idd = @id2', parameters = { id2 = 26, ['@ln2'] = 'MySQL-Async4' } }
}
MySQL.Async.transaction(sqls, function(result)
if result then
print('Success3')
else
print('Failure3')
end
end)
This will print:
Success1
Success2
Failure3