TableField

TableField

Table column information.

Constructor

new TableField()

Source:

Members

_isPrimaryTable

Source:
Properties:
Type Description
Boolean

aggregateFunction

Source:
Properties:
Type Description
String

aliasNames

Source:
Properties:
Type Description
Array.<String>

calculatedFormula

Source:
Properties:
Type Description
String

columnName

Source:
Properties:
Type Description
String

columnTitle

Source:
Properties:
Type Description
String

derivedTableColumn

Source:
Properties:
Type Description
Number

distinctSetting

Source:
Properties:
Type Description
String

fieldName

Source:
Properties:
Type Description
String

isPrimaryTable

Description:
  • Is this field in the primary table.

Source:

Is this field in the primary table.

originalTable

Source:
Properties:
Type Description
String

originalTableColumn

Source:
Properties:
Type Description
Number

selectColumn

Source:
Properties:
Type Description
Number

subQueryAst

Source:
Properties:
Type Description
Object

tableColumn

Description:
  • Get field column number.

Source:

Get field column number.

tableInfo

Source:
Properties:
Type Description
Table

tempField

Source:
Properties:
Type Description
Boolean

Methods

addAlias(columnAlias) → {TableField}

Description:
  • Alias name assigned to field in select statement.

Source:
Parameters:
Name Type Description
columnAlias String

alias name

Returns:
Type
TableField

getData(tableRow) → {any}

Description:
  • Retrieve field data for tableRow

Source:
Parameters:
Name Type Description
tableRow Number

row to read data from

Returns:
  • data
Type
any

setAggregateFunction(value) → {TableField}

Description:
  • Aggregate function number used (e.g. 'SUM')

Source:
Parameters:
Name Type Description
value String

aggregate function name or ''

Returns:
Type
TableField

setCalculatedFormula(value) → {TableField}

Description:
  • Calculated formula for field (e.g. 'CASE WHEN QUANTITY >= 100 THEN 1 ELSE 0 END')

Source:
Parameters:
Name Type Description
value String
Returns:
Type
TableField

setColumnName(columnName) → {TableField}

Description:
  • Set the columnname.

Source:
Parameters:
Name Type Description
columnName String
Returns:
Type
TableField

setColumnTitle(columnTitle) → {TableField}

Description:
  • Set column TITLE. If an alias is available, that is used - otherwise it is column name.

Source:
Parameters:
Name Type Description
columnTitle String

column title used in output

Returns:
Type
TableField

setDistinctSetting(distinctSetting) → {TableField}

Description:
  • Set any count modified like 'DISTINCT' or 'ALL'.

Source:
Parameters:
Name Type Description
distinctSetting String
Returns:
Type
TableField

setIsPrimaryTable(isPrimary) → {TableField}

Description:
  • Set if this field belongs to primary table (i.e. select * from table), rather than a joined tabled.

Source:
Parameters:
Name Type Description
isPrimary Boolean

true if from primary table.

Returns:
Type
TableField

setIsTempField(value) → {TableField}

Description:
  • Fields referenced BUT not in final output.

Source:
Parameters:
Name Type Description
value Boolean
Returns:
Type
TableField

setOriginalTable(table) → {TableField}

Description:
  • Original table name before any derived table updates.

Source:
Parameters:
Name Type Description
table String

original table name

Returns:
Type
TableField

setOriginalTableColumn(column) → {TableField}

Description:
  • Column name found in column title row.

Source:
Parameters:
Name Type Description
column Number
Returns:
Type
TableField

setSelectColumn(column) → {TableField}

Description:
  • Set column number in table data for field.

Source:
Parameters:
Name Type Description
column Number

column number.

Returns:
Type
TableField

setSubQueryAst(ast) → {TableField}

Description:
  • The AST from just the subquery in the SELECT.

Source:
Parameters:
Name Type Description
ast Object

subquery ast.

Returns:
Type
TableField

setTableInfo(tableInfo) → {TableField}

Description:
  • Link this field to the table info.

Source:
Parameters:
Name Type Description
tableInfo Table
Returns:
Type
TableField

(static) getAllExtendedAliasNames(masterFields) → {Array.<String>}

Description:
  • Search through list of fields and return a list of those that include the table name (e.g. TABLE.COLUMN vs COLUMN)

Source:
Parameters:
Name Type Description
masterFields Array.<TableField>
Returns:
Type
Array.<String>