use super::Function;
use crate::ast::Table;
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "docs", doc(cfg(feature = "postgresql")))]
#[cfg(all(feature = "json", feature = "postgresql"))]
pub struct RowToJson<'a> {
pub(crate) expr: Table<'a>,
pub(crate) pretty_print: bool,
}
#[cfg_attr(feature = "docs", doc(cfg(feature = "postgresql")))]
#[cfg(all(feature = "json", feature = "postgresql"))]
pub fn row_to_json<'a, T>(expr: T, pretty_print: bool) -> Function<'a>
where
T: Into<Table<'a>>,
{
let fun = RowToJson { expr: expr.into(), pretty_print };
fun.into()
}