SqlSets

SqlSets

Deals with processing SET theory on SELECT table results.

Constructor

new SqlSets()

Source:

Methods

(static) applySet(type, leftTableData, rightTableData) → {Array.<Array.<any>>}

Description:
  • Apply set theory to data.

Source:
Parameters:
Name Type Description
type String

("UNION", "UNION ALL", "INTERSECT", "EXCEPT")

leftTableData Array.<Array.<any>>
rightTableData Array.<Array.<any>>
Returns:
Type
Array.<Array.<any>>

(static) exceptRows(srcData, newData) → {Array.<Array.<any>>}

Description:
  • Returns all rows in srcData MINUS any rows that match it from newData.

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

starting table

newData Array.<Array.<any>>

minus table (if it matches srcData row)

Returns:
  • srcData MINUS newData
Type
Array.<Array.<any>>

(static) getSetType(ast) → {String}

Description:
  • Determine what set type is applied to the select results.

Source:
Parameters:
Name Type Description
ast Object
Returns:
Type
String

(static) getUnionTypes() → {Array.<String>}

Description:
  • Get list of valid set types.

Source:
Returns:
Type
Array.<String>

(static) intersectRows(srcData, newData) → {Array.<Array.<any>>}

Description:
  • Finds the rows that are common between srcData and newData

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

table data

newData Array.<Array.<any>>

table data

Returns:
  • returns only rows that intersect srcData and newData.
Type
Array.<Array.<any>>

(static) isSqlSet(ast) → {Boolean}

Source:
Parameters:
Name Type Description
ast Object
Returns:
Type
Boolean

(static) removeDuplicateRows(srcData) → {Array.<Array.<any>>}

Description:
  • Remove all duplicate table rows

Source:
Parameters:
Name Type Description
srcData Array.<Array.<any>>
Returns:
Type
Array.<Array.<any>>