import {mapping} from "cassandra-driver"; import {CodegenQueryOperator} from "./types/utils"; export const queryOperator = { // Not the actual return type. This is an ugly hack to squeeze type-safety out of the third party QueryOperator functions. in_: function in_(arr: T[]): CodegenQueryOperator { return mapping.q.in_(arr) as any; }, gt: function gt(value: T): CodegenQueryOperator{ return mapping.q.gt(value) as any; }, gte: function gte(value: T): CodegenQueryOperator{ return mapping.q.gte(value) as any; }, lt: function lt(value: T): CodegenQueryOperator{ return mapping.q.lt(value) as any; }, lte: function lte(value: T): CodegenQueryOperator{ return mapping.q.lte(value) as any; }, notEq: function notEq(value: T): CodegenQueryOperator{ return mapping.q.notEq(value) as any; }, and: function and(condition1: CodegenQueryOperator, condition2: CodegenQueryOperator): CodegenQueryOperator{ return mapping.q.and(condition1, condition2) as any; }, incr: function incr(value: T): CodegenQueryOperator{ return mapping.q.incr(value) as any; }, decr: function decr(value: T): CodegenQueryOperator{ return mapping.q.decr(value) as any; }, append: function append(value: T): CodegenQueryOperator{ return mapping.q.append(value) as any; }, prepend: function prepend(value: T): CodegenQueryOperator{ return mapping.q.prepend(value) as any; }, remove: function remove(value: T): CodegenQueryOperator{ return mapping.q.remove(value) as any; }, }