mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
1.2 KiB
1.2 KiB
Documentation
Introduction
oxmysql is a database wrapper for FiveM utilising node-mysql2 offering improved performance and security.
Query cache
Every executed query is being prepared and stored into cache for faster performance when using prepared statements. These statements are also being sanitized from vulnerable SQL injection.
The following syntaxes are all supported.
'SELECT * FROM `users` WHERE `identifier` = ? AND `group` = ?', { playerIdentifier, playerGroup }
'SELECT * FROM `users` WHERE ?? = ? AND ?? = ?', {'identifier', playerIdentifier, 'group', playerGroup}
'SELECT * FROM `users` WHERE identifier = :identifier', {identifier=playerIdentifier}
'SELECT * FROM `users` WHERE identifier = @identifier', {['@identifier']=playerIdentifier}
Installation
- Download
oxmysql.zipfrom https://github.com/overextended/oxmysql/releases/latest - Extract
oxmysqlto your resources folder - Add
ensure oxmysqlbefore your resources inserver.cfg
Configuration
set mysql_connection_string "mysql://user:password@host/database?charset=utf8mb4"
set mysql_slow_query_warning 100