Constructor
new Table(tableName)
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String | name of sql table. |
Members
hasColumnTitle
Properties:
Type | Description |
---|---|
Boolean |
schema
Properties:
Type | Description |
---|---|
Schema |
tableData
Properties:
Type | Description |
---|---|
Array.<Array.<any>> | table data. |
tableName
Properties:
Type | Description |
---|---|
String | table name. |
Methods
addColumnLetters(tableData) → {Array.<Array.<any>>}
- Description:
Internal function for updating the loaded data to include column names using letters, starting from 'A', 'B',...
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tableData |
Array.<Array.<any>> | table data that does not currently contain a first row with column names. |
Returns:
- updated table data that includes a column title row.
- Type
- Array.<Array.<any>>
concat(concatTable) → {void}
- Description:
Append table data from 'concatTable' to the end of this tables existing data.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
concatTable |
Table | Append 'concatTable' data to end of current table data. |
Returns:
- Type
- void
createCalcFieldRecordMap(calcSqlField, calcField) → {Map.<String, Array.<Number>>}
- Description:
The calculated field is evaluated for every record in the table. Each unique calculated value will map to a list of table record numbers where the calculated value will be found.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
calcSqlField |
CalculatedField | |
calcField |
String |
Returns:
- Type
- Map.<String, Array.<Number>>
createKeyFieldRecordMap(fieldName, calcSqlField, calcField) → {Map.<String, Array.<Number>>}
- Description:
Create a logical table index on input field name. The resulting map is stored with the table. The Map<fieldDataItem, [rowNumbers]> is stored.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
fieldName |
String | field name to index. |
|
calcSqlField |
CalculatedField |
null
|
|
calcField |
String |
Returns:
- Type
- Map.<String, Array.<Number>>
getAllExtendedNotationFieldNames() → {Array.<String>}
- Description:
Returns table field names that are prefixed with table name.
- Source:
Returns:
- field names
- Type
- Array.<String>
getAllFieldNames() → {Array.<String>}
- Description:
Returns a list of all possible field names that could be used in the SELECT.
- Source:
Returns:
- List of field names.
- Type
- Array.<String>
getAllVirtualFields() → {Array.<VirtualField>}
Returns:
- field column information list
- Type
- Array.<VirtualField>
getColumnCount() → {Number}
Returns:
- column count.
- Type
- Number
getFieldColumn(fieldName) → {Number}
Parameters:
Name | Type | Description |
---|---|---|
fieldName |
String | Valid field name. |
Returns:
- column offset number starting at zero.
- Type
- Number
getFieldColumns(fieldNames) → {Array.<Number>}
Parameters:
Name | Type | Description |
---|---|---|
fieldNames |
Array.<String> | list of valid field names. |
Returns:
- list of column offsets, starting at zero corresponding to the input list of names.
- Type
- Array.<Number>
getRecords(startRecord, lastRecord, fields) → {Array.<Array.<any>>}
Parameters:
Name | Type | Description |
---|---|---|
startRecord |
Number | 1 is first record |
lastRecord |
Number | -1 for all. Last = RecordCount(). |
fields |
Array.<Number> | fields to include in output |
Returns:
- subset table data.
- Type
- Array.<Array.<any>>
loadArrayData(tableData) → {Table}
Parameters:
Name | Type | Description |
---|---|---|
tableData |
Array.<any> | Loaded table data with first row titles included. |
Returns:
- Type
- Table
loadNamedRangeData(namedRange, cacheSeconds) → {Table}
Parameters:
Name | Type | Default | Description |
---|---|---|---|
namedRange |
String | defines where data is located in sheets.
|
|
cacheSeconds |
Number |
0
|
How many seconds to cache data so we don't need to make time consuming getValues() from sheets. |
Returns:
- Type
- Table
loadSchema() → {Table}
- Description:
Read loaded table data and updates internal list of column information
- Source:
Returns:
- Type
- Table
numberToSheetColumnLetter(number) → {String}
Parameters:
Name | Type | Description |
---|---|---|
number |
Number | Returns the sheets column name. |
Returns:
- the column letter.
- Type
- String
setHasColumnTitle(hasTitle) → {Table}
Parameters:
Name | Type | Description |
---|---|---|
hasTitle |
Boolean |
|
Returns:
- Type
- Table
setTableAlias(tableAlias) → {Table}
Parameters:
Name | Type | Description |
---|---|---|
tableAlias |
String | table alias that may be used to prefix column names. |
Returns:
- Type
- Table
(static) removeEmptyRecordsAtEndOfTable(tableData) → {Array.<Array.<any>>}
- Description:
It is common to have extra empty records loaded at end of table. Remove those empty records at END of table only.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tableData |
Array.<Array.<any>> |
Returns:
- Type
- Array.<Array.<any>>