class OxMysql
package fivem.server.db
Typed bindings to the oxmysql resource.
Add dependency 'oxmysql' to fxmanifest.lua — nothing else is required,
this talks directly to exports.oxmysql. Server-side only, since oxmysql
itself is a server-only resource.
The plain methods (query, single, scalar, insert, update,
rawExecute, transaction) block the current Citizen coroutine until
oxmysql replies, so the call reads like ordinary synchronous Haxe code.
That's safe from event handlers, threads, and commands — virtually
everywhere FiveM resource code runs. Use the Async variants if you
need a non-blocking, callback-style call instead.
For a sys.db.Connection-based ORM workflow (e.g. the record-macros
haxelib), use OxMysqlConnection instead of calling this directly.
Static methods
staticrawExecute(sql:String, ?params:Array<Dynamic>):Dynamic
Runs sql and returns oxmysql's raw, unprocessed reply.
statictransaction(queries:Array<{values:Null<Array<Dynamic>>, query:String}>):Bool
Runs every {query, values} entry as a single atomic transaction. Returns whether it succeeded.