VirtualFields

VirtualFields

Tracks all fields in a table (including derived tables when there is a JOIN).

Constructor

new VirtualFields()

Source:

Members

virtualFieldList

Source:
Properties:
Type Description
Array.<VirtualField>

List of all fields for table.

virtualFieldMap

Source:
Properties:
Type Description
Map.<String, VirtualField>

Map to field for fast access. Field name is key.

Methods

add(field, checkForDuplicates)

Description:
  • Adds info for one field into master list of fields for table.

Source:
Parameters:
Name Type Default Description
field VirtualField

Information for one field in the table.

checkForDuplicates Boolean false

throws error if adding a duplicate field name.

getAllVirtualFields() → {Array.<VirtualField>}

Description:
  • Returns a list of all fields in table.

Source:
Returns:
Type
Array.<VirtualField>

(static) expandWildcardFields(masterTableInfo, astFields) → {Array.<any>}

Description:
  • When the wildcard '*' is found in the SELECT, it will add all fields in table to the AST used in the SELECT.

Source:
Parameters:
Name Type Description
masterTableInfo Table

The wildcard '*' (if found) will add fields from THIS table to the AST.

astFields Array.<any>

existing SELECT fields list.

Returns:
  • original AST field list PLUS expanded list of fields if '*' was encountered.
Type
Array.<any>