Advertisement

RedM Async - RedM MySQL Async Script For RedM Server

 RedM-async MySQL Async for RedM Servers, All query types in mysql-async can be fired using either Sync or Async methods, which can be retrieved from the MySQL object. The last parameter of an Async function is always the callback, the argument of the callback gets returned by Sync functions.

Contrary to older Sync implementations, these functions are safe to use, since they are non-blocking and just wrappers around the Async calls. But for possible migration to other Database implementations, the use of the Sync functions should be discouraged.

Download

RedM Async - redm-mysql-async

Credit:

INSTALLATION

Set it as a dependency in you __resource.lua or fxmanifest.lua

-- client

client_scripts {

-- Not possible, resource is only server sided

...

}


-- server

server_scripts {

'@mysql-async/lib/MySQL.lua',

...

}


API

MySQL.Async.execute(query, parameters, callback)

MySQL.Async.fetchAll(query, parameters, callback)

MySQL.Async.fetchScalar(query, parameters, callback)

MySQL.Async.transaction(queries, parameters, callback)

MySQL.Sync.execute(query, parameters)

MySQL.Sync.fetchAll(query, parameters)

MySQL.Sync.fetchScalar(query, parameters)

MySQL.Sync.transaction(queries, parameters, callback)

MySQL.ready(callback)

INFO

It uses the https://github.com/warxander/vSql library to provide a connection to your MySQL server.

Post a Comment

0 Comments