Skip to content

Module: Account

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

━ What's the Objective?

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 (Native sync has to be disabled) or work in correlation with default accounts otherwise (Native sync has to be enabled). Refer for sync state's modification.

━ APIs

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

@Objective: Fetches all existing accounts.
local table: result, table: arguments = dbify.module.account.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.account.create() (Server)

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

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

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

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

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

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

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