grafbase_sql_ast/ast/function/
to_jsonb.rs1use super::Function;
2use crate::ast::Table;
3
4#[derive(Debug, Clone, PartialEq)]
5pub struct ToJsonb<'a> {
7 pub(crate) table: Table<'a>,
8}
9
10pub fn to_jsonb<'a>(table: impl Into<Table<'a>>) -> Function<'a> {
12 let fun = ToJsonb {
13 table: table.into(),
14 };
15
16 fun.into()
17}
18
19impl<'a> From<ToJsonb<'a>> for Function<'a> {
20 fn from(value: ToJsonb<'a>) -> Self {
21 Self {
22 typ_: super::FunctionType::ToJsonb(value),
23 alias: None,
24 }
25 }
26}