grafbase_sql_ast/ast/function/
aggregate_to_string.rs1use super::Function;
2use crate::ast::{Expression, FunctionType};
3
4#[derive(Debug, Clone, PartialEq)]
5pub struct AggregateToString<'a> {
8 pub(crate) value: Box<Expression<'a>>,
9}
10
11pub fn aggregate_to_string<'a, T>(expr: T) -> Function<'a>
13where
14 T: Into<Expression<'a>>,
15{
16 let fun = AggregateToString {
17 value: Box::new(expr.into()),
18 };
19
20 fun.into()
21}
22
23impl<'a> From<AggregateToString<'a>> for Function<'a> {
24 fn from(value: AggregateToString<'a>) -> Self {
25 Self {
26 typ_: FunctionType::AggregateToString(value),
27 alias: None,
28 }
29 }
30}