-
-
Notifications
You must be signed in to change notification settings - Fork 0
Module: Account
Аниса edited this page Jun 16, 2022
·
34 revisions
This module synchronizes built in MTA accounts w/ MySQL & provides a management interface to integrate w/ your resources. Module can either be used for custom accounts (Automated sync has to be disabled for this case) or work in correlation with default accounts otherwise (Automated sync has to be enabled for this case). For modifying automated sync's state refer.
Syntax #2 should only be used in conjunction w/ thread
--Syntax #1:
local bool: state = dbify.account.fetchAll(
table: {
--These are conditional datas that has to be used for the query
{string: columnName, ~: columnValue},
},
function: callback(table: result, table: arguments),
~: ...arguments
)
--Syntax #2:
local table: result, table: arguments = self:await(dbify.account.fetchAll(
thread: self,
table: {
--These are conditional datas that has to be used for the query
{string: columnName, ~: columnValue},
},
~: ...arguments
))
--Syntax #1:
local bool: state = dbify.account.create(
string: accountName,
function: callback(bool: result, table: arguments),
~: ...arguments
)
--Syntax #2:
local bool: result, table: arguments = self:await(dbify.account.create(
thread: self,
string: accountName,
~: ...arguments
))
--Syntax #1:
local bool: state = dbify.account.delete(
string: accountName,
function: callback(bool: result, table: arguments),
~: ...arguments
)
--Syntax #2:
local bool: result, table: arguments = self:await(dbify.account.delete(
thread: self,
string: accountName,
~: ...arguments
))
--Syntax #1:
local bool: state = dbify.account.setData(
string: accountName,
table: {
--These are account datas to be updated
{string: columnName, ~: columnValue},
...
},
function: callback(bool: result, table: arguments),
~: ...arguments
)
dbify.account.getData(accountName, {
--These are account datas to be retrieved
dataName1,
dataName2,
...
}, callback(result, arguments)
print(toJSON(result))
print(toJSON(arguments))
end, ...)