Table

Table

new Table(tableId, tableName)

Source:
Parameters:
Name Type Description
tableId number
tableName string

Methods

convertColumnToMultilanguage(columnName, pickLanguage)

Description:
  • Convenient method to change a single language column to multi language
Source:
Parameters:
Name Type Description
columnName string
pickLanguage string language in which raw values should be inserted (default: "first language of '/system/settings/langtags'")

convertColumnToSinglelanguage(columnName, pickLanguage)

Description:
  • Convenient method to change a multi language column to single language
Source:
Parameters:
Name Type Description
columnName string
pickLanguage string language from which values are taken as new values (default: first language of '/system/settings/langtags')

createColumn(columnBuilder) → {number}

Source:
Parameters:
Name Type Description
columnBuilder ColumnBuilder
Returns:
column id
Type
number

createColumns(columnBuilderArray) → {Array.<Column>}

Source:
Parameters:
Name Type Description
columnBuilderArray Array.<ConstraintBuilder>
Returns:
Type
Array.<Column>

createRow() → {number}

Source:
Returns:
row id
Type
number

createRowByObj(columnNameToValueObject) → {number}

Source:
Parameters:
Name Type Description
columnNameToValueObject object
Returns:
row id
Type
number

createRows(rows, columns) → {Array.<number>}

Source:
Parameters:
Name Type Description
rows Array.<Array.<any>>
columns Array.<number>
Returns:
array of row ids
Type
Array.<number>

deleteColumn(nameOrId)

Source:
Parameters:
Name Type Description
nameOrId string | number

fetch(includeRows) → {Table}

Description:
  • Fetches meta and columns for this Table object.
Source:
Parameters:
Name Type Default Description
includeRows boolean false retrieves rows (default: false)
Returns:
Type
Table

findColumn(nameOrId)

Source:
Parameters:
Name Type Description
nameOrId string | number

getRow(id) → {Object}

Description:
  • Returns a single row object zipped with column names for this Table. The `rowId` property represents the row ID (PK) of the database, so this value can be reused for updates/deletions/etc.
Source:
Parameters:
Name Type Description
id number
Returns:
row object
Type
Object

getRows() → {Array.<object>}

Description:
  • Returns an array of row objects zipped with column names for this Table. The `rowId` property represents the row ID (PK) of the database, so this value can be reused for updates/deletions/etc.
Source:
Returns:
array row objects
Type
Array.<object>