Skip to content

Releases: overextended/oxmysql

v1.5.1

08 Oct 03:09
93ff6ba
Compare
Choose a tag to compare

Features

  • lib: safeArguments function to assert types (Linden)

Bug Fixes

  • Incorrect exports used in sync functions for transaction, single, and insert #40 (H@mer)

Chores

  • Update readme (Linden)
  • Update dependencies and version bump (Linden)

v1.5.0

06 Oct 21:53
Compare
Choose a tag to compare

Features

  • Add support for semicolon connection strings (Linden)
  • Imports file for "mysql-async" like usage (Linden)
  • ci: Include mysql-async compat library (Dunak)

Chores

v1.4.1

27 Sep 00:14
Compare
Choose a tag to compare

Features

Bug Fixes

  • Regex fix for queries with commas (#31) #31 (1A3)
  • pool: Increase default connection timeout (Linden)

Chores

  • Version bump and set to production (Linden)

Commits

  • b8249d5: Implemented the ability to change the port. (gixels) #27

v1.4.0

20 Sep 15:34
Compare
Choose a tag to compare

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

Code Refactoring

  • Transaction tweaks and version bump 1.4.0 (dunak-debug)

v1.3.5

20 Sep 11:48
Compare
Choose a tag to compare

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

v1.3.4

19 Sep 19:39
a0573c8
Compare
Choose a tag to compare

Features

  • Change game to common to enable support for other game like rdr3 #22 (BerkieBb)

v1.3.3

18 Sep 18:55
Compare
Choose a tag to compare

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

18 Sep 10:46
Compare
Choose a tag to compare

Features

Code Refactoring

  • safeCallback provides a warning, rather than an error (Linden)

Chores

v1.3.1

18 Sep 00:38
Compare
Choose a tag to compare

Features

  • Enable JS sync exports if wrapper.lua is not loaded (Linden)

Commits

  • Query execution times are less precise unless using debug mode (Linden)
  • Provide information when callback fails (Linden)

v1.3.0

17 Sep 20:24
Compare
Choose a tag to compare

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

Chores