Members
firstCase
Properties:
| Type | Description | 
|---|---|
| Boolean | when working on each WHEN/THEN in CASE, is this the first one encountered.  | 
        
matchCaseWhenThenStr
Properties:
| Type | Description | 
|---|---|
| String | regex to find components of CASE statement.  | 
        
originalCaseStatement
Properties:
| Type | Description | 
|---|---|
| String | Original CASE statement.  | 
        
originalFunctionString
Properties:
| Type | Description | 
|---|---|
| String | Existing state of function string when CASE encountered.  | 
        
referencedTableColumns
Properties:
| Type | Description | 
|---|---|
| Array.<String> | 
Methods
adddate(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
case(_parms, args) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
_parms | 
            
            Array.<String> | |
args | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
caseEnd(func, funcString) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
func | 
            
            String | current function being processed. If <> 'CASE', ignore.  | 
        
funcString | 
            
            String | current SQL/javascript string in the process of being converted to js.  | 
        
Returns:
- updated js code
 
- Type
 - String
 
caseStart(func, args, functionString) → {Array.<any>}
- Description:
 When examining the SQL Select CASE, parse for next WHEN,END condition.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
func | 
            
            String | current function worked on. If <> 'CASE', ignore.  | 
        
args | 
            
            Array.<any> | default return value.  | 
        
functionString | 
            
            String | 
Returns:
- Type
 - Array.<any>
 
caseWhen(args) → {String}
- Description:
 Convert SQL CASE to javascript executeable code to solve case options.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
args | 
            
            Array.<any> | current CASE WHEN strings. 
  | 
        
Returns:
- js code to handle this WHEN case.
 
- Type
 - String
 
ceiling(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
charindex(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
coalesce(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
concat(parms, _args, masterFields) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | |
_args | 
            
            Array.<String> | |
masterFields | 
            
            Array.<TableField> | 
Returns:
- Type
 - String
 
concat_ws(parms, _args, masterFields) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | |
_args | 
            
            Array.<String> | |
masterFields | 
            
            Array.<TableField> | 
Returns:
- Type
 - String
 
convert(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
convertToJs(calculatedFormula, masterFields) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
calculatedFormula | 
            
            String | contains SQL formula and parameter(s)  | 
        
masterFields | 
            
            Array.<TableField> | table fields  | 
        
Returns:
- javascript code
 
- Type
 - String
 
curdate() → {String}
Returns:
- Type
 - String
 
datediff(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
day(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
floor(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
getReferencedColumns() → {Array.<String>}
Returns:
- Type
 - Array.<String>
 
if(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
left(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
len(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
length(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
log(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
log10(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
lower(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
ltrim(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
month(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
now() → {String}
Returns:
- Type
 - String
 
parseFunctionArgs(func, functionString) → {Array.<String>}
- Description:
 Search for SELECT function arguments for specified 'func' only. Special case for 'CASE'. It breaks down one WHEN condition at a time.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
func | 
            
            String | an SQL function name.  | 
        
functionString | 
            
            String | SELECT SQL string to search  | 
        
Returns:
- Type
 - Array.<String>
 
power(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
rand() → {String}
Returns:
- Type
 - String
 
replicate(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
reverse(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
right(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
round(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
rtrim(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
space(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
sqrt(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
stuff(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
substr(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
substring(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
trim(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
upper(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
year(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<String> | 
Returns:
- Type
 - String
 
(static) adddate(parms) → {String}
- Description:
 Add number of days to a date and return JS code to return this date.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<any> | parms[0] - A date. parms[1] - Number of days to add to the date.  | 
        
Returns:
- Type
 - String
 
(static) charIndex(parms) → {String}
- Description:
 Find the position of a substring within a field - in javascript code.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<any> | 
  | 
        
Returns:
- javascript code to find substring position.
 
- Type
 - String
 
(static) coalesce(parms) → {String}
- Description:
 Returns first non-empty value in a list, in javascript code.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<any> | coalesce parameters - no set limit for number of inputs.  | 
        
Returns:
- javascript to solve
 
- Type
 - String
 
(static) concat(parms, masterFields) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<any> | |
masterFields | 
            
            Array.<TableField> | 
Returns:
- Type
 - String
 
(static) concat_ws(parms, masterFields) → {String}
- Description:
 Concatenate all data and use separator between concatenated fields.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<any> | 
  | 
        
masterFields | 
            
            Array.<TableField> | fields in table.  | 
        
Returns:
- javascript to concatenate all data.
 
- Type
 - String
 
(static) convert(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<any> | 
  | 
        
Returns:
- javascript to convert data to specified type.
 
- Type
 - String
 
(static) datediff(parms) → {String}
Parameters:
| Name | Type | Description | 
|---|---|---|
parms | 
            
            Array.<any> | 
Returns:
- Type
 - String