Releases: overextended/oxmysql
Releases · overextended/oxmysql
v1.5.1
v1.5.0
Features
- Add support for semicolon connection strings (Linden)
- Imports file for "mysql-async" like usage (Linden)
- ci: Include mysql-async compat library (Dunak)
Chores
- Bump to 1.5.0 (dunak-debug)
v1.4.1
v1.4.0
Transactions are now supported thanks to @darksaid98
Syntax:
-- Shared Param Format
local queries = {
'INSERT INTO `bans` (token) VALUES (:test)',
'INSERT INTO `bans` (token) VALUES (:test)',
'INSERT INTO `bans` (token) VALUES (:test)',
}
local params = { ['test'] = 'thisisatestvalue' }
exports.oxmysql:transaction(queries, params, function(result)
print(result) -- true/false
end)
-- Specific Format
local queries = {
{ query = 'INSERT INTO `test` (id, text) VALUES (:nene, :meme)', values = { ['nene'] = 'thisisatest', ['meme'] = 'this is a text' } },
{ query = 'INSERT INTO `test` (id, text) VALUES (:nene, :meme)', values = { ['nene'] = 'thisisates2', ['meme'] = 'this is a text' } },
{ query = 'INSERT INTO `test` (id) VALUES (:nene)', parameters = { ['nene'] = 'thisisatest4' } },
}
exports.oxmysql:transaction(queries, function(result)
print(result) -- true/false
end)
Allows setting isolation level for transactions through convar mysql_transaction_isolation_level
.
The default value is 2
, it accepts integers 1-4
.
switch (GetConvarInt('mysql_transaction_isolation_level', 2)) {
case 1:
return 'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ';
case 2:
return 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED';
case 3:
return 'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED';
case 4:
return 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE';
default:
return 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED';
};
Features
- Added transactions support (#20) #20 (darksaid98)
Code Refactoring
- Transaction tweaks and version bump 1.4.0 (dunak-debug)
v1.3.5
Bug Fixes
- Return null if query failed, show callback warning only in debug (dunak-debug)
- Allow passing callback as second parameter (dunak-debug)
Code Refactoring
- Use logical OR operator when checking callback parameter (dunak-debug)
Chores
- Bump version to 1.3.5 (dunak-debug)
v1.3.4
v1.3.3
Stops displaying warnings when an async export does not receive a third callback argument.
If an argument is defined, but it is not a function then you will receive an error.
This makes callbacks optional for when you don't require any results from the database.
Commits
- Only display warnings if callback is defined (Linden)
v1.3.2
Features
- Show error trace if debug is enabled (dunak-debug)
Code Refactoring
- safeCallback provides a warning, rather than an error (Linden)
Chores
- Bump version to 1.3.2 (dunak-debug)
v1.3.1
v1.3.0
GHMATTI REPLACEMENT COMPATIBLE NOW (test before going to production)
Features
- New js sync exports (disabled by default) (Linden)
Bug Fixes
- Parameter parsing, new update export, null parameter warning (dunak-debug)
- Patch named placeholders, throw errors on nil values (dunak-debug)
- Typo in wrapper (dunak-debug)
- Use query instead of execute always (dunak-debug)
- Execute export result checking (dunak-debug)
- Don´t throw error if parameter is zero or false, check for undefined (dunak-debug)
Code Refactoring
- Split files into src folder, fix parser (dunak-debug)
- Show error type of nil params (dunak-debug)
- Execute now return whole result object (dunak-debug)
Chores
- add prettier config (dunak-debug)