Skip to content

Glossary: MySQL

Tron edited this page Dec 20, 2022 · 11 revisions

━ What's the Objective?

DBify's MySQL pipeline simulates and mimics Sequelize (ORM) like simple, efficient & reliable MySQL management. All APIs are in asynchronous and ORM format; Thus, are supposed to be used in conjunction w/ Assetify's thread module.

Wait no more, switch to DBify and eliminate the extra hassle & worries regarding sql-injection & server freezing/network-trouble; Let DBify increase your productivity & manage it for you right out of the box😉.

━ APIs

━ dbify.mysql.table.fetchList() (Server)

@Objective: Fetches the list of tables within the database.
local table: result, table: arguments = dbify.mysql.table.fetchList(
  ~: ...arguments
)

━ dbify.mysql.table.isValid() (Server)

@Objective: Validates the existence of a MySQL table.
local bool: result, table: arguments = dbify.mysql.table.isValid(
  string: tableName,
  ~: ...arguments
)

━ dbify.mysql.table.areValid() (Server)

@Objective: Validates the existence of multiple MySQL tables.
local bool: result, table: arguments = dbify.mysql.table.areValid(
  table: {
    --Tables to be validated
    string: tableName,
    ...
  },
  bool: isFetchInvalid, --Enabling this returns only invalid tables
  ~: ...arguments
)

━ dbify.mysql.table.create()

@Objective: Creates a fresh table as per desired structure.
local bool: result, table: arguments = dbify.mysql.table.create(
  string: tableName,
  table: {
    {string: columnName, string: columnType},
    ...
  },
  ~: ...arguments
)

━ dbify.mysql.table.delete()

@Objective: Deletes specified tables from the database.
local bool: result, table: arguments = dbify.mysql.table.delete(
  table: {
    --Tables to be deleted
    string: tableName,
    ...
  },
  ~: ...arguments
)

━ dbify.mysql.table.truncate()

@Objective: Truncates specified tables from the database.
local bool: result, table: arguments = dbify.mysql.table.truncate(
  table: {
    --Tables to be truncated
    string: tableName,
    ...
  },
  ~: ...arguments
)

━ dbify.mysql.table.fetchContents() (Server)

@Objective: Fetches desired contents of a valid MySQL table.
local table: result, table: arguments = dbify.mysql.table.fetchContents(
  string: tableName,
  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.mysql.column.fetchList() (Server)

@Objective: Fetches the list of columns within a valid MySQL table.
local table: result, table: arguments = dbify.mysql.column.fetchList(
  string: tableName
  ~: ...arguments
)

━ dbify.mysql.column.isValid() (Server)

@Objective: Validates the existence of column of a valid MySQL table.
local bool: result, table: arguments = dbify.mysql.column.isValid(
  string: tableName,
  string: columnName,
  ~: ...arguments
)

━ dbify.mysql.column.areValid() (Server)

@Objective: Validates the existence of multiple columns of a valid MySQL table.
local bool: result, table: arguments = dbify.mysql.column.areValid(
  string: tableName,
  table: {
    --Columns to be validated
    string: columnName,
    ...
  },
  bool: isFetchInvalid, --Enabling this returns only invalid columns
  ~: ...arguments
)

━ dbify.mysql.column.delete()

@Objective: Deletes specified columns of a valid MySQL table.
local bool: result, table: arguments = dbify.mysql.column.delete(
  string: tableName,
  table: {
    --Columns to be deleted
    string: columnName,
    ...
  },
  ~: ...arguments
)

━ dbify.mysql.data.set() (Server)

@Objective: Sets column datas of a valid MySQL table.
local bool: result, table: arguments = dbify.mysql.data.set(
  string: tableName,
  table: {
    --Columns to be updated w/ their respective values
    {string: columnName, ~: columnValue},
    ...
  },
  table: {
    --Conditional datas to be used for the query
    {string: columnName, ~: columnValue},
    ...
  },
  ~: ...arguments
)

━ dbify.mysql.data.get() (Server)

@Objective: Retrieves column datas of a valid MySQL table.
local table: result, table: arguments = dbify.mysql.data.get(
  string: tableName,
  table: {
    --Columns whose values are to be retrieved
    string: columnName,
    ...
  },
  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
)
Clone this wiki locally