Schema

Schema

Class contains information about each column in the SQL table.

Constructor

new Schema()

Source:

Members

fields

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

String=Field Name, Number=Column Number

isDerivedTable

Source:
Properties:
Type Description
Boolean

Is this a derived table.

tableAlias

Source:
Properties:
Type Description
String

Alias name of table.

tableData

Source:
Properties:
Type Description
Array.<Array.<any>>

Table data double array.

tableInfo

Source:
Properties:
Type Description
Table

Link to table info object.

tableName

Source:
Properties:
Type Description
String

Table name.

virtualFields

Source:
Properties:
Type Description
VirtualFields

Methods

getAllExtendedNotationFieldNames() → {Array.<String>}

Description:
  • All table fields names with 'TABLE.field_name'.

Source:
Returns:
  • list of all field names with table prefix.
Type
Array.<String>

getAllFieldNames() → {Array.<String>}

Description:
  • Retrieve all field names for this table.

Source:
Returns:
  • List of field names.
Type
Array.<String>

getAllVirtualFields() → {Array.<VirtualField>}

Description:
  • Get a list of all virtual field data associated with this table.

Source:
Returns:
Type
Array.<VirtualField>

getColumnNameVariants(colName) → {FieldVariants}

Description:
  • Find all valid variations for a column name. This will include base column name, the column name prefixed with full table name, and the column name prefixed with table alias.

Source:
Parameters:
Name Type Description
colName String
Returns:
Type
FieldVariants

getFieldColumn(field) → {Number}

Description:
  • Get the column number for the specified field name.

Source:
Parameters:
Name Type Description
field String

Field name to find column number for.

Returns:
  • Column number.
Type
Number

getFieldColumns(fieldNames) → {Array.<Number>}

Description:
  • Get field column index (starts at 0) for field names.

Source:
Parameters:
Name Type Description
fieldNames Array.<String>

find columns for specific fields in table.

Returns:
  • column numbers for each specified field.
Type
Array.<Number>

load() → {Schema}

Description:
  • The field name is found in TITLE row of sheet. These column titles are TRIMMED, UPPERCASE and SPACES removed (made to UNDERSCORE). SQL statements MUST reference fields with spaces converted to underscore.

Source:
Returns:
Type
Schema

setFieldVariantsColumNumber(fieldVariants, colNum)

Description:
  • Associate table column number to each possible variation of column name.

Source:
Parameters:
Name Type Description
fieldVariants FieldVariants
colNum Number

setTable(tableInfo) → {Schema}

Description:
  • Set the existing 'Table' info.

Source:
Parameters:
Name Type Description
tableInfo Table

table object.

Returns:
Type
Schema

setTableAlias(tableAlias) → {Schema}

Description:
  • Associate the table alias to this object.

Source:
Parameters:
Name Type Description
tableAlias String

table alias name

Returns:
Type
Schema

setTableData(tableData) → {Schema}

Description:
  • Associate table data with this object.

Source:
Parameters:
Name Type Description
tableData Array.<Array.<any>>

double array of table data.

Returns:
Type
Schema

setTableName(tableName) → {Schema}

Description:
  • Set table name in this object.

Source:
Parameters:
Name Type Description
tableName String

Table name to remember.

Returns:
Type
Schema