UNPKG

@qrvey/formula-lang

Version:

QFormula support for qrvey projects

45 lines 1.07 kB
import { AST_PRIMITIVES, OPERATION_SCOPE } from '../constants'; import { isStringParam } from '../utils'; /** * `LOWER` Returns the string give it in lower case. */ export const LOWER = { identifier: 'LOWER', operationScope: OPERATION_SCOPE.RAW, functionScope: [OPERATION_SCOPE.RAW], parameters: [ { identifier: 'STRING', optional: false, expectedPrimitive: AST_PRIMITIVES.STRING, validator: [isStringParam], }, ], transpiler: { elasticsearch, snowflake, redshift, postgresql, databricks, }, primitiveResult: AST_PRIMITIVES.STRING, }; function elasticsearch(current) { return `${current}.toLowerCase()`; } function SQL(current) { return `LOWER(${current})`; } function snowflake(current) { return SQL(current); } function redshift(current) { return SQL(current); } function postgresql(current) { return SQL(current); } function databricks(current) { return SQL(current); } //# sourceMappingURL=lower.js.map