Skip to content

Glossary: Module

Аниса edited this page Dec 17, 2022 · 6 revisions

━ dbify.createModule() (Server)

@Objective: Creates a fresh custom dbify module as per specified structure.
local table: cModule = dbify.createModule({
    moduleName = "yourModuleName", --Used for accessing module globally via `dbify.module.yourModuleName`
    tableName = "yourtablename", --Name of table to create for the specified module
    structure = {
        --Structure based on which the table shall be created
        {"id", "BIGINT AUTO_INCREMENT PRIMARY KEY"},
        {"name", "TEXT NOT NULL"},
        {"age", "INT"},
        {"country", "TEXT DEFAULT='N/A'"}
    }
})

━ Methods

━ cModule.fetchAll() (Server)

@Objective: Fetches all existing identities.
local table: result, table: arguments = cModule.fetchAll(
  table: {
    --Conditional datas to be used for the query
    {string: columnName, ~: columnValue},
    ...
  },
  bool: isSoloFetch, --Enabling this returns only first row of the retrieved result
  ~: ...arguments
)

━ cModule.create() (Server)

@Objective: Creates a new identity.
local bool: result, table: arguments = cModule.create(
  ~: identifier,
  ~: ...arguments
)

━ cModule.delete() (Server)

@Objective: Deletes an existing identity.
local bool: result, table: arguments = cModule.delete(
  ~: identifier,
  ~: ...arguments
)

━ cModule.setData() (Server)

@Objective: Sets identity datas of a valid identity.
local bool: result, table: arguments = cModule.setData(
  ~: identifier,
  table: {
    --Columns to be updated w/ their respective values
    {string: columnName, ~: columnValue},
    ...
  },
  ~: ...arguments
)

━ cModule.getData() (Server)

@Objective: Retrieves identity datas of a valid identity.
local table: result, table: arguments = cModule.getData(
  ~: identifier,
  table: {
    --Columns whose values are to be retrieved
    string: columnName,
    ...
  },
  ~: ...arguments
)
Clone this wiki locally