UNPKG

@qrvey/formula-lang

Version:

QFormula support for qrvey projects

40 lines 931 B
import { minuteScript } from '../utils/elasticsearch/scripts'; import { isDateParam } from '../utils'; import { AST_PRIMITIVES } from '../constants'; /** * Returns the number of the MINUTE in a Date. */ export const MINUTE = { identifier: 'MINUTE', parameters: [ { identifier: 'DATE', optional: false, expectedPrimitive: AST_PRIMITIVES.DATE, validator: [isDateParam], }, ], transpiler: { elasticsearch, snowflake, redshift, postgresql, }, primitiveResult: AST_PRIMITIVES.NUMBER, }; function elasticsearch(value) { return minuteScript(value); } function SQL(value) { return `DATE_PART('minute', ${value})`; } function snowflake(value) { return SQL(value); } function redshift(value) { return SQL(value); } function postgresql(value) { return SQL(value); } //# sourceMappingURL=minute.js.map