Skip to main content

toasty_core/stmt/
func_unnest.rs

1use super::{Expr, ExprFunc};
2
3/// The PostgreSQL `unnest` set-returning function.
4///
5/// The argument is an array expression. PostgreSQL emits one output row for
6/// each array element.
7#[derive(Clone, Debug, PartialEq)]
8pub struct FuncUnnest {
9    /// The array expression.
10    pub arg: Box<Expr>,
11}
12
13impl From<FuncUnnest> for ExprFunc {
14    fn from(value: FuncUnnest) -> Self {
15        Self::Unnest(value)
16    }
17}
18
19impl From<FuncUnnest> for Expr {
20    fn from(value: FuncUnnest) -> Self {
21        Self::Func(value.into())
22    }
23}