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

staticinsert(sql:String, ?params:Array<Dynamic>):Int

staticinsertAsync(sql:String, ?params:Array<Dynamic>, ?callback:(id:Int) ‑> Void):Void

staticquery(sql:String, ?params:Array<Dynamic>):Array<Dynamic>

staticqueryAsync(sql:String, ?params:Array<Dynamic>, ?callback:(rows:Array<Dynamic>) ‑> Void):Void

staticrawExecute(sql:String, ?params:Array<Dynamic>):Dynamic

Runs sql and returns oxmysql's raw, unprocessed reply.

staticscalar(sql:String, ?params:Array<Dynamic>):Dynamic

staticsingle(sql:String, ?params:Array<Dynamic>):Dynamic

@:has_untypedstatictransaction(queries:Array<{values:Null<Array<Dynamic>>, query:String}>):Bool

Runs every {query, values} entry as a single atomic transaction. Returns whether it succeeded.

staticupdate(sql:String, ?params:Array<Dynamic>):Int

staticupdateAsync(sql:String, ?params:Array<Dynamic>, ?callback:(affected:Int) ‑> Void):Void