Skip to content

Module: Character

Аниса edited this page Jun 16, 2022 · 27 revisions

━ dbify.character.fetchAll() (Server)

@Objective: Fetches all existing characters.
local bool: state = dbify.character.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.character.fetchAll(
  thread: self,
  table: {
    --These are conditional datas that has to be used for the query
    {string: columnName, ~: columnValue},
  },
  ~: ...arguments
))

━ dbify.character.create() (Server)

@Objective: Creates a new character.
dbify.character.create(callback(characterID, arguments)
    print(tostring(characterID))
    print(toJSON(arguments))
end, ...)

━ dbify.character.delete() (Server)

@Objective: Deletes an existing character.
dbify.character.delete(characterID, callback(result, arguments)
    print(tostring(result))
    print(toJSON(arguments))
end, ...)

━ dbify.character.setData() (Server)

@Objective: Sets character datas of a valid character.
dbify.character.setData(characterID, {
    --These are character datas to be updated
    {dataName1, dataValue1},
    {dataName2, dataValue2},
    ...
}, callback(result, arguments)
    print(tostring(result))
    print(toJSON(arguments))
end, ...)

━ dbify.character.getData() (Server)

@Objective: Retrieves character datas of a valid character.
dbify.character.getData(characterID, {
    --These are character datas to be retrieved
    dataName1,
    dataName2,
    ...
}, callback(result, arguments)
    print(toJSON(result))
    print(toJSON(arguments))
end, ...)
Clone this wiki locally