-
-
Notifications
You must be signed in to change notification settings - Fork 0
Module: Account
Аниса edited this page Jun 16, 2022
·
34 revisions
This module aims at providing Sequelize
(ORM) inspired efficient & reliable MySQL management. All APIs are in the format of ORM to eliminate the extra hassle & worries regarding sql-injection. Additionally it comes w/ built in Async/Await support to avoid callback hells which can be used in conjunction w/ thread
module!
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
))
dbify.account.create(accountName, callback(result, arguments)
print(tostring(result))
print(toJSON(arguments))
end, ...)
dbify.account.delete(accountName, callback(result, arguments)
print(tostring(result))
print(toJSON(arguments))
end, ...)
dbify.account.setData(accountName, {
--These are account datas to be updated
{dataName1, dataValue1},
{dataName2, dataValue2},
...
}, callback(result, arguments)
print(tostring(result))
print(toJSON(arguments))
end, ...)
dbify.account.getData(accountName, {
--These are account datas to be retrieved
dataName1,
dataName2,
...
}, callback(result, arguments)
print(toJSON(result))
print(toJSON(arguments))
end, ...)