-
-
Notifications
You must be signed in to change notification settings - Fork 0
Glossary: Module
Аниса edited this page Dec 17, 2022
·
6 revisions
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'"}
}
})
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
)
local bool: result, table: arguments = cModule.create(
~: identifier,
~: ...arguments
)
local bool: result, table: arguments = cModule.delete(
~: identifier,
~: ...arguments
)
local bool: result, table: arguments = cModule.setData(
~: identifier,
table: {
--Columns to be updated w/ their respective values
{string: columnName, ~: columnValue},
...
},
~: ...arguments
)
local table: result, table: arguments = cModule.getData(
~: identifier,
table: {
--Columns whose values are to be retrieved
string: columnName,
...
},
~: ...arguments
)