use query::Operand;
use query::operand::ToOperand;
use query::source::QuerySource;
#[derive(Debug)]
#[derive(Clone)]
pub struct Function {
pub function: String,
pub params: Vec<Operand>,
}
pub fn COUNT(to_operand: &ToOperand) -> Operand {
Operand::QuerySource(QuerySource::Function(Function {
function: "COUNT".to_owned(),
params: vec![to_operand.to_operand()],
}))
}
pub fn MAX(to_operand: &ToOperand) -> Operand {
Operand::QuerySource(QuerySource::Function(Function {
function: "MAX".to_owned(),
params: vec![to_operand.to_operand()],
}))
}
pub fn MIN(to_operand: &ToOperand) -> Operand {
Operand::QuerySource(QuerySource::Function(Function {
function: "MIN".to_owned(),
params: vec![to_operand.to_operand()],
}))
}
pub fn NOW() -> Operand {
Operand::QuerySource(QuerySource::Function(Function {
function: "NOW".to_owned(),
params: vec![],
}))
}