Skip to content

Module: Account

Аниса edited this page Dec 13, 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 (Automated sync has to be disabled) or work in correlation with default accounts otherwise (Automated sync has to be enabled). For modifying automated sync's state refer.

━ APIs

━ dbify.account.fetchAll() (Server)

@Objective: Fetches all existing accounts.
local table: result, table: arguments = dbify.account.fetchAll(
  table: {
    --Conditional datas to be used for the query
    {string: columnName, ~: columnValue},
  },
  ~: ...arguments
)

━ dbify.account.create() (Server)

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

━ dbify.account.delete() (Server)

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

━ dbify.account.setData() (Server)

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

━ dbify.account.getData() (Server)

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