Releases: overextended/oxmysql
Releases Β· overextended/oxmysql
v2.12.0
- External logger services can now be loaded with
set mysql_logger_service '@resource/path.js'
. - Added support for mysql_option(s) in resource metadata (fxmanifest).
- Added
mysql_option 'return_callback_errors'
, allowing error handling in your callbacks.
MySQL.scalar('SELECT datefOfBirth FROM characters LIMIT 1', function(res, err)
if err then error(err) end
print('scalar', res)
end)
- Added
MySQL.startTransaction
to library.
local success = MySQL.startTransaction(function(query)
local a = query('INSERT INTO users (identifier) VALUES (?)', { 'someid' })
-- if a is undefined, return false and rollback
if not a then
return false
end
-- errors in a query (e.g. syntax) will result in a rollback
local b = query('SELEC * FROM users WHERE id = ? LIMIT 1', { a.insertId })
-- transactions timeout after 30s to prevent connections being locked
Wait(30000)
-- throwing an error during a transaction will rollback
if not b then
error('sad')
end
-- no return, or any truthy value, will commit the transaction and release the connection
end)
print(success)
Features
- lib/lua: add options and 'return_callback_errors' (Linden)
- add startTransaction to library (Linden)
- logger: support loading external loggers (Linden)
Bug Fixes
- logger: catch errors when triggering error callback (Linden)
- lib: assert query value when using query store (Linden)
- revert citizenfx/server dependency update (Linden)
- update types/node (Linden)
- web: update and resolve conflicting dependencies (Linden)
- utils/parseArguments: resolve null parameters in sparse arrays (Linden)
- db/pool: set pool after confirming a connection (Linden)
- db/pool: don't manually fetch connection (Linden)
Code Refactoring
- database/pool: link to issues when connection fails (Linden)
Chores
- update package dependencies (Linden)
- deps-dev: bump vite from 4.2.0 to 4.5.5 in /web #244 (dependabot[bot])
- deps: bump braces from 3.0.2 to 3.0.3 in /web #241 (dependabot[bot])
- deps: bump micromatch from 4.0.5 to 4.0.8 in /web #242 (dependabot[bot])
- deps: bump postcss from 8.4.21 to 8.4.31 in /web #240 (dependabot[bot])
Commits
- bfe660b: v2.11.2 (GitHub Actions)
v2.11.2
v2.11.1
v2.11.0
Features
- logger: add fivemanage logging service #232 (Linden)
- utils/typeCast: support date typecasting for binary protocol #232 (Linden)
Bug Fixes
- update: catch error on failed fetch (Linden)
- database/connection: return promise from commit method #232 (Linden)
- database/connection: disable typecasting for execute method #232 (Linden)
- utils/typeCast: correctly parse null date fields #232 (Linden)
- patches/mysql: missing charset patch #232 (Linden)
- config: allow database to be undefined in uri #232 (Linden)
Code Refactoring
- database: add new connection class and misc tweaks #232 (Linden)
- profiler: move from logger module #232 (Linden)
- database/pool: warn if using multipleStatements #232 (Linden)
- logger: dynamically load logger service (Linden)
Chores
- update dependencies #232 (Linden)
- utils/typeCast: use patched type #232 (Linden)
- update dependencies #232 (Linden)
- update build target to nodejs 20 #232 (Linden)
- update package dependencies #232 (Linden)
Commits
v2.10.1
v2.10.0
v2.9.1
(Experimental) New transaction usage
This function is not yet fully supported and will receive breaking changes in future updates - this export and information is provided only for feedback and testing purposes.
Sample usage of the new transaction export.
CreateThread(function()
local success = exports.oxmysql:experimentalTransaction(function(query)
local a = query('INSERT INTO users (identifier) VALUES (?)', { 'someid' })
if not a then return false end -- if a is undefined, return false and rollback
-- local b = query('SELEC * FROM users WHERE id = ? LIMIT 1', { a.insertId }) -- syntax error leads to rollback
-- Wait(30000) -- connection will timeout and rollback transaction
-- error('sad') -- any errors will rollback
-- no return, or any truthy value, will commit the transaction and release the connection
end)
print(success)
end)
Bug Fixes
- db: incorrect error handling when no callback is defined (Linden)
Code Refactoring
- db/startTransaction: remove execute from cb (Linden)
- db/startTransaction: add 30s timeout to transactions (Linden)
- db/startTransaction: include query and values in errors (Linden)
Commits
- 8b8670e: v2.9.0 (GitHub Actions)
v2.9.0
Features
- db: experimental transaction export (Linden)
Bug Fixes
Code Refactoring
- db/connection: set and get active connections (Linden)
- db/startTransaction: use internal query functions (Linden)
Continuous Integration
- release: update checkout action (Linden)
- release: push updates to repo (Linden)
- release: set repo ref to main (Linden)
Commits
- 0ede55d: Create FUNDING.yml (Linden)