Methods
addBindVariable(bindVar) → {Select2Object}
- Description:
If bind variables are used in SELECT statement, this are added here. Ordering is important. The first one added will be '?1' in the select, second is '?2' in select...
- Source:
Parameters:
Name | Type | Description |
---|---|---|
bindVar |
any |
Returns:
- Type
- Select2Object
addTableData(tableName, data) → {Select2Object}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tableName |
String | table name referenced in SELECT statement. |
data |
* | double array or string. If string it must reference A1 notation, named range or sheet name. |
Returns:
- Type
- Select2Object
execute(statement) → {Array.<Object>}
- Description:
Query any sheet range using standard SQL SELECT syntax and return array of table info with column names as properties.
- Source:
Example
gsSQL("select * from expenses where type = ?1")
Parameters:
Name | Type | Description |
---|---|---|
statement |
String | SQL string |
Returns:
- array of object data.
- Type
- Array.<Object>
(static) cleanupColumnNames(cols) → {Array.<String>}
- Description:
Return column names in lower case and remove table name when only one table.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
cols |
Array.<String> |
Returns:
- Type
- Array.<String>
(static) createEmptyRecordObject(columnNames) → {Object}
- Description:
Creates an empty object where each column name is a property in the object.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
columnNames |
Array.<String> |
Returns:
- Type
- Object
(static) createTableObjectArray(columnNames, tableDataArray) → {Array.<Object>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
columnNames |
Array.<String> | |
tableDataArray |
Array.<any> |
Returns:
- Type
- Array.<Object>