AdaptableQL Expression Technical Reference
Summary
- Expression Options contains many properties to configure AdapTableQl and Expressions
- The Expression API section of AdapTable API provides run-time access to Expressions
Expression Options
The ExpressionOptions section of Adaptable Options contains options for using AdapTableQL Expressions:
| Property | Type | Description | Default |
|---|---|---|---|
| caseSensitiveExpressions | boolean | Perform case-sensitive text comparisons when evaluating Expressions | false |
| customAggregatedFunctions | Record<string,AggregatedExpressionFunction> | ((context:GlobalExpressionFunctionsContext<string>) => Record<string,AggregatedExpressionFunction>) | Bespoke Aggregated functions - to complement those provided by AdapTable | |
| customBooleanFunctions | Record<string,ExpressionFunction> | ((context:GlobalExpressionFunctionsContext<BooleanFunctionName>) => Record<string,ExpressionFunction>) | Custom Boolean Expression Functions available in AdapTableQL | null (none) |
| customQueryVariables | Record<string, string | number | boolean | Date | ((context:CustomQueryVariableContext) => string | number | boolean | Date)> | Values to be attached to variables so that a single value can easily be expressed multiple times within a query, or quickly changed to affect the results of a query; evaluated synchronously with each expression evaluation | |
| customScalarFunctions | Record<string,ExpressionFunction> | ((context:GlobalExpressionFunctionsContext<ScalarFunctionName>) => Record<string,ExpressionFunction>) | Custom Scalar Expression Functions available in AdapTableQL | null (none) |
| displayColumnFriendlyNamesForExpressions | boolean | Reference a Column's Header (i.e. FriendlyName) in all Expression overviews (instead of ColumnId) | true |
| evaluateAdaptableQLExternally | (context:EvaluateExpressionExternallyContext<TData>) => boolean | Whether a Module (or specific expression) should be evaluated by AdapTableQL | All Modules are evaluated by AdapTable |
| fields | AdaptableField[] | ((context:AdaptableFieldContext) =>AdaptableField[]) | Fields are items in Data Source that are NOT columns but can be used in Expressions (via FIELD keyword) | |
| isColumnQueryable | (queryableColumnContext:QueryableColumnContext) => boolean | Can a given column be included in Expressions | |
| maxTimeframeSize | number | Maximum time (in milliseconds) to hold a Data Change event in a trailing timeframe | 28800000 (~8 hours) |
| moduleExpressionFunctions | ModuleExpressionFunctionsMap| ((context:ModuleExpressionFunctionsContext) =>ModuleExpressionFunctions | undefined) | Module-specific Expression Functions available | undefined (defaults to available System & Custom values) |
| performExpressionValidation | boolean | Validate Expressions before they can be run or saved | true |
| systemAggregatedBooleanFunctions | AggregatedBooleanFunctionName[] | ((context:GlobalExpressionFunctionsContext<AggregatedBooleanFunctionName>) =>AggregatedBooleanFunctionName[]) | System AggregatedBoolean Expression Functions available in AdapTableQL | null (sets all) |
| systemAggregatedScalarFunctions | AggregatedScalarFunctionName[] | ((context:GlobalExpressionFunctionsContext<AggregatedScalarFunctionName>) =>AggregatedScalarFunctionName[]) | System AggregatedScalar Expression Functions available in AdapTableQL | undefined (sets all) |
| systemBooleanFunctions | BooleanFunctionName[] | ((context:GlobalExpressionFunctionsContext<BooleanFunctionName>) =>BooleanFunctionName[]) | System Boolean Expression Functions available in AdapTableQL | null (sets all) |
| systemObservableFunctions | ObservableFunctionName[] | ((context:GlobalExpressionFunctionsContext<ObservableFunctionName>) =>ObservableFunctionName[]) | System Observable Expression Functions available in AdapTableQL | null (sets all) |
| systemScalarFunctions | ScalarFunctionName[] | ((context:GlobalExpressionFunctionsContext<ScalarFunctionName>) =>ScalarFunctionName[]) | System Scalar Expression Functions available in AdapTableQL | null (sets all) |
Expression API
Expression API section of Adaptable API contains functions which enable run-time access of AdapTableQL.
| Method | Returns | Description |
|---|---|---|
| getAdaptableQueryExpression(query) | string | undefined | Returns Expression string of given AdaptableQuery: can be Boolean, AggregatedBoolean, Scalar, AggregatedScalar or Observable |
| getAdaptableQueryExpressionWithColumnFriendlyNames(query) | string | undefined | Returns Expression string of given AdaptableQuery with column friendly names (instead of Column IDs) |
| getASTForExpression(expression) | any | Runs the AST that AdapTableQL creates for an Expression - useful when evaluating remotely |
| getColumnsFromExpression(expression) | string[] | Returns all Columns referenced in an Expression |
| isColumnQueryable(abColumn) | boolean | Returns whether a Column is Queryable |
| isValidAggregatedBooleanExpression(expression, module, validationErrorMessage) | boolean | Whether the given AggregatedBooleanExpression is valid |
| isValidAggregatedScalarExpression(expression, module, validationErrorMessage) | boolean | Whether the given AggregatedScalarExpression is valid |
| isValidBooleanExpression(expression, module, validationErrorMessage) | boolean | Whether the given BooleanExpression is valid |
| isValidObservableExpression(expression, module, validationErrorMessage) | boolean | Whether the given ObservableExpression is valid |
| useCaseSensitivity() | boolean | Whether Expressions are evaluated using Case Sensitivity |