Skip to content

Module: Serial

Аниса edited this page Dec 16, 2022 · 25 revisions

━ What's the Objective?

This module synchronizes built in MTA serials w/ MySQL & provides a management interface to integrate w/ your resources.

Module can either be used for custom serials (Native sync has to be disabled) or work in correlation with default serials otherwise (Native sync has to be enabled). Refer for sync state's modification.

━ APIs

━ dbify.module.serial.fetchAll() (Server)

@Objective: Fetches all existing serials.
local table: result, table: arguments = dbify.module.serial.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
)

━ dbify.module.serial.create() (Server)

@Objective: Creates a new serial.
local bool: result, table: arguments = dbify.module.serial.create(
  string: serial,
  ~: ...arguments
)

━ dbify.module.serial.delete() (Server)

@Objective: Deletes an existing serial.
local bool: result, table: arguments = dbify.module.serial.delete(
  string: serial,
  ~: ...arguments
)

━ dbify.module.serial.setData() (Server)

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

━ dbify.module.serial.getData() (Server)

@Objective: Retrieves serial datas of a valid serial.
local table: result, table: arguments = dbify.module.serial.getData(
  string: serial,
  table: {
    --Columns whose values are to be retrieved
    string: columnName,
    ...
  },
  ~: ...arguments
)