Skip to main content

diesel/sqlite/expression/
functions.rs

1//! SQLite specific functions
2#[cfg(doc)]
3use crate::expression::functions::aggregate_expressions::AggregateExpressionMethods;
4use crate::expression::functions::declare_sql_function;
5use crate::expression_methods::json_expression_methods::private::JsonOrNullableJsonOrJsonbOrNullableJsonb;
6use crate::sql_types::*;
7use crate::sqlite::expression::expression_methods::BinaryOrNullableBinary;
8use crate::sqlite::expression::expression_methods::JsonOrNullableJson;
9use crate::sqlite::expression::expression_methods::MaybeNullableValue;
10use crate::sqlite::expression::expression_methods::NotBlob;
11use crate::sqlite::expression::expression_methods::TextOrNullableText;
12use crate::sqlite::expression::expression_methods::TextOrNullableTextOrBinaryOrNullableBinary;
13use crate::sqlite::expression::functions::helper::CombinedNullableValue;
14
15#[cfg(feature = "__sqlite-shared")]
16#[doc =
" Verifies that its argument is a valid JSON string or JSONB blob and returns a minified"]
#[doc =
" version of that JSON string with all unnecessary whitespace removed."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::json;"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Text, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = ""]
#[doc =
" let result = diesel::select(json::<Text, _>(r#\"{\"a\": \"b\", \"c\": 1}\"#))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(json!({\"a\":\"b\",\"c\":1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json::<Text, _>(r#\"{ \"this\" : \"is\", \"a\": [ \"test\" ] }\"#))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(json!({\"a\":[\"test\"],\"this\":\"is\"}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json::<Nullable<Text>, _>(None::<&str>))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = ""]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json<E: TextOrNullableText + MaybeNullableValue<Json>, e>(e: e)
    -> json<E, e> where e: diesel::expression::AsExpression<E> {
    json_utils::json { e: e.as_expression(), E: ::core::marker::PhantomData }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json()`](fn@json)"]
pub type json<E, e> =
    json_utils::json<E,
    <e as diesel::expression::AsExpression<E>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_return_type {
    #[doc = "Return type of the [`json()`](fn@super::json) SQL function."]
    pub type json<e> =
        super::json<<e as diesel::expression::Expression>::SqlType, e>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json<E, e> {
        pub(in super) e: e,
        pub(in super) E: ::core::marker::PhantomData<E>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<E, e, __Rhs> ::core::ops::Add<__Rhs> for json<E, e> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<E, e, __Rhs> ::core::ops::Sub<__Rhs> for json<E, e> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<E, e, __Rhs> ::core::ops::Mul<__Rhs> for json<E, e> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<E, e, __Rhs> ::core::ops::Div<__Rhs> for json<E, e> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<E: ::core::fmt::Debug, e: ::core::fmt::Debug> ::core::fmt::Debug for
        json<E, e> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f, "json", "e",
                &self.e, "E", &&self.E)
        }
    }
    #[automatically_derived]
    impl<E: ::core::clone::Clone, e: ::core::clone::Clone>
        ::core::clone::Clone for json<E, e> {
        #[inline]
        fn clone(&self) -> json<E, e> {
            json {
                e: ::core::clone::Clone::clone(&self.e),
                E: ::core::clone::Clone::clone(&self.E),
            }
        }
    }
    #[automatically_derived]
    impl<E: ::core::marker::Copy, e: ::core::marker::Copy>
        ::core::marker::Copy for json<E, e> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<E: diesel::query_builder::QueryId,
                e: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json<E, e> {
                type QueryId =
                    json<<E as diesel::query_builder::QueryId>::QueryId,
                    <e as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <E as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <e as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        && true;
                const IS_WINDOW_FUNCTION: bool =
                    <E as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <e as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json()`](fn@json)"]
    pub type HelperType<E, e> = json<E, <e as AsExpression<E>>::Expression>;
    impl<E: TextOrNullableText + MaybeNullableValue<Json>, e> Expression for
        json<E, e> where (e): Expression {
        type SqlType = E::Out;
    }
    impl<E: TextOrNullableText + MaybeNullableValue<Json>, e,
        __DieselInternal> SelectableExpression<__DieselInternal> for
        json<E, e> where e: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<E: TextOrNullableText + MaybeNullableValue<Json>, e,
        __DieselInternal> AppearsOnTable<__DieselInternal> for json<E, e>
        where e: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<E: TextOrNullableText + MaybeNullableValue<Json>, e,
        __DieselInternal> FunctionFragment<__DieselInternal> for json<E, e>
        where __DieselInternal: diesel::backend::Backend,
        e: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.e.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.e.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<E: TextOrNullableText + MaybeNullableValue<Json>, e>
        QueryFragment<crate::sqlite::Sqlite> for json<E, e> where
        e: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<e>(e);
    const _: () =
        {
            use diesel;
            impl<e, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<e> where
                e: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <e as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<E: TextOrNullableText + MaybeNullableValue<Json>, e,
        __DieselInternal> ValidGrouping<__DieselInternal> for json<E, e> where
        __Derived<e>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<e> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The jsonb(X) function returns the binary JSONB representation of the JSON provided as argument X."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.45 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, jsonb};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Text, Binary, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 45, 0);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb::<Binary, _>(br#\"{\"a\": \"b\", \"c\": 1}\"#))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(json!({\"a\": \"b\", \"c\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb::<Binary, _>(br#\"{\"this\":\"is\",\"a\":[\"test\"]}\"#))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(json!({\"this\":\"is\",\"a\":[\"test\"]}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb::<Nullable<Binary>, _>(None::<Vec<u8>>))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = ""]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>, e>(e: e)
    -> jsonb<E, e> where e: diesel::expression::AsExpression<E> {
    jsonb_utils::jsonb {
        e: e.as_expression(),
        E: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb()`](fn@jsonb)"]
pub type jsonb<E, e> =
    jsonb_utils::jsonb<E,
    <e as diesel::expression::AsExpression<E>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_return_type {
    #[doc = "Return type of the [`jsonb()`](fn@super::jsonb) SQL function."]
    pub type jsonb<e> =
        super::jsonb<<e as diesel::expression::Expression>::SqlType, e>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb<E, e> {
        pub(in super) e: e,
        pub(in super) E: ::core::marker::PhantomData<E>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<E, e, __Rhs> ::core::ops::Add<__Rhs> for jsonb<E, e> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<E, e, __Rhs> ::core::ops::Sub<__Rhs> for jsonb<E, e> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<E, e, __Rhs> ::core::ops::Mul<__Rhs> for jsonb<E, e> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<E, e, __Rhs> ::core::ops::Div<__Rhs> for jsonb<E, e> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<E: ::core::fmt::Debug, e: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb<E, e> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f, "jsonb",
                "e", &self.e, "E", &&self.E)
        }
    }
    #[automatically_derived]
    impl<E: ::core::clone::Clone, e: ::core::clone::Clone>
        ::core::clone::Clone for jsonb<E, e> {
        #[inline]
        fn clone(&self) -> jsonb<E, e> {
            jsonb {
                e: ::core::clone::Clone::clone(&self.e),
                E: ::core::clone::Clone::clone(&self.E),
            }
        }
    }
    #[automatically_derived]
    impl<E: ::core::marker::Copy, e: ::core::marker::Copy>
        ::core::marker::Copy for jsonb<E, e> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<E: diesel::query_builder::QueryId,
                e: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for jsonb<E, e> {
                type QueryId =
                    jsonb<<E as diesel::query_builder::QueryId>::QueryId,
                    <e as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <E as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <e as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        && true;
                const IS_WINDOW_FUNCTION: bool =
                    <E as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <e as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb()`](fn@jsonb)"]
    pub type HelperType<E, e> = jsonb<E, <e as AsExpression<E>>::Expression>;
    impl<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>, e> Expression
        for jsonb<E, e> where (e): Expression {
        type SqlType = E::Out;
    }
    impl<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>, e,
        __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb<E, e> where e: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>, e,
        __DieselInternal> AppearsOnTable<__DieselInternal> for jsonb<E, e>
        where e: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>, e,
        __DieselInternal> FunctionFragment<__DieselInternal> for jsonb<E, e>
        where __DieselInternal: diesel::backend::Backend,
        e: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.e.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.e.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>, e>
        QueryFragment<crate::sqlite::Sqlite> for jsonb<E, e> where
        e: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<e>(e);
    const _: () =
        {
            use diesel;
            impl<e, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<e> where
                e: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <e as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>, e,
        __DieselInternal> ValidGrouping<__DieselInternal> for jsonb<E, e>
        where __Derived<e>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<e> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The json_array_length(X) function returns the number of elements in the JSON array X,"]
#[doc = " or 0 if X is some kind of JSON value other than an array."]
#[doc =
" Errors are thrown if either X is not well-formed JSON or if P is not a well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.46 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_array_length};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Json, Jsonb, Text, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 46, 0);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length::<Json, _>(json!([1,2,3,4])))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(4, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length::<Json, _>(json!({\"one\":[1,2,3]})))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(0, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length::<Nullable<Json>, _>(None::<Value>))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length::<Jsonb, _>(json!([1,2,3,4])))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(4, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length::<Jsonb, _>(json!({\"one\":[1,2,3]})))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(0, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length::<Nullable<Jsonb>, _>(None::<Value>))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_array_length<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Integer>, j>(j: j) -> json_array_length<J, j> where
    j: diesel::expression::AsExpression<J> {
    json_array_length_utils::json_array_length {
        j: j.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_array_length()`](fn@json_array_length)"]
pub type json_array_length<J, j> =
    json_array_length_utils::json_array_length<J,
    <j as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_array_length_return_type {
    #[doc =
    "Return type of the [`json_array_length()`](fn@super::json_array_length) SQL function."]
    pub type json_array_length<j> =
        super::json_array_length<<j as
        diesel::expression::Expression>::SqlType, j>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_array_length_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_array_length<J, j> {
        pub(in super) j: j,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, j, __Rhs> ::core::ops::Add<__Rhs> for
                json_array_length<J, j> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Sub<__Rhs> for
                json_array_length<J, j> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Mul<__Rhs> for
                json_array_length<J, j> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Div<__Rhs> for
                json_array_length<J, j> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, j: ::core::fmt::Debug> ::core::fmt::Debug for
        json_array_length<J, j> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_array_length", "j", &self.j, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, j: ::core::clone::Clone>
        ::core::clone::Clone for json_array_length<J, j> {
        #[inline]
        fn clone(&self) -> json_array_length<J, j> {
            json_array_length {
                j: ::core::clone::Clone::clone(&self.j),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, j: ::core::marker::Copy>
        ::core::marker::Copy for json_array_length<J, j> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                j: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_array_length<J, j> {
                type QueryId =
                    json_array_length<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <j as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <j as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        && true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <j as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`json_array_length()`](fn@json_array_length)"]
    pub type HelperType<J, j> =
        json_array_length<J, <j as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Integer>, j> Expression for json_array_length<J, j>
        where (j): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Integer>, j, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_array_length<J, j>
        where j: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Integer>, j, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_array_length<J, j> where
        j: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Integer>, j, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_array_length<J, j> where
        __DieselInternal: diesel::backend::Backend,
        j: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_array_length";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.j.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.j.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Integer>, j> QueryFragment<crate::sqlite::Sqlite>
        for json_array_length<J, j> where
        j: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<j>(j);
    const _: () =
        {
            use diesel;
            impl<j, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<j> where
                j: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <j as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Integer>, j, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_array_length<J, j> where
        __Derived<j>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<j> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The json_array_length(X) function returns the number of elements in the JSON array X,"]
#[doc = " or 0 if X is some kind of JSON value other than an array."]
#[doc =
" The json_array_length(X,P) locates the array at path P within X and returns the length of that array,"]
#[doc = " or 0 if path P locates an element in X that is not a JSON array,"]
#[doc = " and NULL if path P does not locate any element of X."]
#[doc =
" Errors are thrown if either X is not well-formed JSON or if P is not a well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.46 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_array_length_with_path};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Json, Jsonb, Text, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 46, 0);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length_with_path::<Json, _, _>(json!([1,2,3,4]), \"$\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(4), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length_with_path::<Json, _, _>(json!([1,2,3,4]), \"$[2]\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(0), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length_with_path::<Json, _, _>(json!({\"one\":[1,2,3]}), \"$.one\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(3), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length_with_path::<Nullable<Json>, _, _>(json!({\"one\":[1,2,3]}), \"$.two\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!([1,2,3,4]), \"$\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(4), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!([1,2,3,4]), \"$[2]\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(0), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!({\"one\":[1,2,3]}), \"$.one\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(3), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_length_with_path::<Nullable<Jsonb>, _, _>(json!({\"one\":[1,2,3]}), \"$.two\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_array_length_with_path<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, j, path>(j: j, path: path)
    -> json_array_length_with_path<J, j, path> where
    j: diesel::expression::AsExpression<J>,
    path: diesel::expression::AsExpression<Text> {
    json_array_length_with_path_utils::json_array_length_with_path {
        j: j.as_expression(),
        path: path.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_array_length_with_path()`](fn@json_array_length_with_path)"]
pub type json_array_length_with_path<J, j, path> =
    json_array_length_with_path_utils::json_array_length_with_path<J,
    <j as diesel::expression::AsExpression<J>>::Expression,
    <path as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_array_length_with_path_return_type {
    #[doc =
    "Return type of the [`json_array_length_with_path()`](fn@super::json_array_length_with_path) SQL function."]
    pub type json_array_length_with_path<j, path> =
        super::json_array_length_with_path<<j as
        diesel::expression::Expression>::SqlType, j, path>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_array_length_with_path_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_array_length_with_path<J, j, path> {
        pub(in super) j: j,
        pub(in super) path: path,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, j, path, __Rhs> ::core::ops::Add<__Rhs> for
                json_array_length_with_path<J, j, path> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, j, path, __Rhs> ::core::ops::Sub<__Rhs> for
                json_array_length_with_path<J, j, path> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, j, path, __Rhs> ::core::ops::Mul<__Rhs> for
                json_array_length_with_path<J, j, path> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, j, path, __Rhs> ::core::ops::Div<__Rhs> for
                json_array_length_with_path<J, j, path> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, j: ::core::fmt::Debug,
        path: ::core::fmt::Debug> ::core::fmt::Debug for
        json_array_length_with_path<J, j, path> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_array_length_with_path", "j", &self.j, "path",
                &self.path, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, j: ::core::clone::Clone,
        path: ::core::clone::Clone> ::core::clone::Clone for
        json_array_length_with_path<J, j, path> {
        #[inline]
        fn clone(&self) -> json_array_length_with_path<J, j, path> {
            json_array_length_with_path {
                j: ::core::clone::Clone::clone(&self.j),
                path: ::core::clone::Clone::clone(&self.path),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, j: ::core::marker::Copy,
        path: ::core::marker::Copy> ::core::marker::Copy for
        json_array_length_with_path<J, j, path> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                j: diesel::query_builder::QueryId,
                path: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_array_length_with_path<J, j, path> {
                type QueryId =
                    json_array_length_with_path<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <j as diesel::query_builder::QueryId>::QueryId,
                    <path as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <j as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <path as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <j as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <path as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc =
    "The return type of [`json_array_length_with_path()`](fn@json_array_length_with_path)"]
    pub type HelperType<J, j, path> =
        json_array_length_with_path<J, <j as AsExpression<J>>::Expression,
        <path as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path>
        Expression for json_array_length_with_path<J, j, path> where
        (j, path): Expression {
        type SqlType = Nullable<Integer>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path,
        __DieselInternal> SelectableExpression<__DieselInternal> for
        json_array_length_with_path<J, j, path> where
        j: SelectableExpression<__DieselInternal>,
        path: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path,
        __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_array_length_with_path<J, j, path> where
        j: AppearsOnTable<__DieselInternal>,
        path: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path,
        __DieselInternal> FunctionFragment<__DieselInternal> for
        json_array_length_with_path<J, j, path> where
        __DieselInternal: diesel::backend::Backend,
        j: QueryFragment<__DieselInternal>,
        path: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_array_length";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.j.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.j.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path>
        QueryFragment<crate::sqlite::Sqlite> for
        json_array_length_with_path<J, j, path> where
        j: QueryFragment<crate::sqlite::Sqlite>,
        path: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<j, path>(j, path);
    const _: () =
        {
            use diesel;
            impl<j, path, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<j, path> where
                j: diesel::expression::ValidGrouping<__GroupByClause>,
                path: diesel::expression::ValidGrouping<__GroupByClause>,
                <j as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<j as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path,
        __DieselInternal> ValidGrouping<__DieselInternal> for
        json_array_length_with_path<J, j, path> where
        __Derived<j, path>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<j, path> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The json_error_position(X) function returns 0 if the input X is a well-formed JSON or JSON5 string."]
#[doc =
" If the input X contains one or more syntax errors, then this function returns the character position of the first syntax error."]
#[doc = " The left-most character is position 1."]
#[doc = ""]
#[doc =
" If the input X is a BLOB, then this routine returns 0 if X is a well-formed JSONB blob. If the return value is positive,"]
#[doc =
" then it represents the approximate 1-based position in the BLOB of the first detected error."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.46 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_error_position};"]
#[doc = " #     use diesel::sql_types::{Binary, Text, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 46, 0);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_error_position::<Text, _>(r#\"{\"a\": \"b\", \"c\": 1}\"#))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(0, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_error_position::<Text, _>(r#\"{\"a\": b\", \"c\": 1}\"#))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(7, result);"]
#[doc = ""]
#[doc = " let json5 = r#\""]
#[doc = "     {"]
#[doc = "         // A traditional message."]
#[doc = "         message: \'hello world\',"]
#[doc = ""]
#[doc = "         // A number for some reason."]
#[doc = "         n: 42,"]
#[doc = "     }"]
#[doc = " \"#;"]
#[doc = " let result ="]
#[doc =
"     diesel::select(json_error_position::<Text, _>(json5)).get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(0, result);"]
#[doc = ""]
#[doc = " let json5_with_error = r#\""]
#[doc = "     {"]
#[doc = "         // A traditional message."]
#[doc = "         message: hello world\',"]
#[doc = ""]
#[doc = "         // A number for some reason."]
#[doc = "         n: 42,"]
#[doc = "     }"]
#[doc = " \"#;"]
#[doc =
" let result = diesel::select(json_error_position::<Text, _>(json5_with_error))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(59, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_error_position::<Nullable<Text>, _>(None::<&str>))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_error_position::<Binary, _>(br#\"{\"a\": \"b\", \"c\": 1}\"#))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(0, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_error_position::<Binary, _>(br#\"{\"a\": b\", \"c\": 1}\"#))"]
#[doc = "     .get_result::<i32>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(7, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_error_position::<Nullable<Binary>, _>(None::<Vec<u8>>))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_error_position<X: TextOrNullableTextOrBinaryOrNullableBinary +
    MaybeNullableValue<Integer>, x>(x: x) -> json_error_position<X, x> where
    x: diesel::expression::AsExpression<X> {
    json_error_position_utils::json_error_position {
        x: x.as_expression(),
        X: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_error_position()`](fn@json_error_position)"]
pub type json_error_position<X, x> =
    json_error_position_utils::json_error_position<X,
    <x as diesel::expression::AsExpression<X>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_error_position_return_type {
    #[doc =
    "Return type of the [`json_error_position()`](fn@super::json_error_position) SQL function."]
    pub type json_error_position<x> =
        super::json_error_position<<x as
        diesel::expression::Expression>::SqlType, x>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_error_position_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_error_position<X, x> {
        pub(in super) x: x,
        pub(in super) X: ::core::marker::PhantomData<X>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<X, x, __Rhs> ::core::ops::Add<__Rhs> for
                json_error_position<X, x> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<X, x, __Rhs> ::core::ops::Sub<__Rhs> for
                json_error_position<X, x> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<X, x, __Rhs> ::core::ops::Mul<__Rhs> for
                json_error_position<X, x> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<X, x, __Rhs> ::core::ops::Div<__Rhs> for
                json_error_position<X, x> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<X: ::core::fmt::Debug, x: ::core::fmt::Debug> ::core::fmt::Debug for
        json_error_position<X, x> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_error_position", "x", &self.x, "X", &&self.X)
        }
    }
    #[automatically_derived]
    impl<X: ::core::clone::Clone, x: ::core::clone::Clone>
        ::core::clone::Clone for json_error_position<X, x> {
        #[inline]
        fn clone(&self) -> json_error_position<X, x> {
            json_error_position {
                x: ::core::clone::Clone::clone(&self.x),
                X: ::core::clone::Clone::clone(&self.X),
            }
        }
    }
    #[automatically_derived]
    impl<X: ::core::marker::Copy, x: ::core::marker::Copy>
        ::core::marker::Copy for json_error_position<X, x> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<X: diesel::query_builder::QueryId,
                x: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_error_position<X, x> {
                type QueryId =
                    json_error_position<<X as
                    diesel::query_builder::QueryId>::QueryId,
                    <x as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <X as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <x as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        && true;
                const IS_WINDOW_FUNCTION: bool =
                    <X as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <x as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`json_error_position()`](fn@json_error_position)"]
    pub type HelperType<X, x> =
        json_error_position<X, <x as AsExpression<X>>::Expression>;
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary +
        MaybeNullableValue<Integer>, x> Expression for
        json_error_position<X, x> where (x): Expression {
        type SqlType = X::Out;
    }
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary +
        MaybeNullableValue<Integer>, x, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_error_position<X, x>
        where x: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary +
        MaybeNullableValue<Integer>, x, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_error_position<X, x> where
        x: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary +
        MaybeNullableValue<Integer>, x, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_error_position<X, x> where
        __DieselInternal: diesel::backend::Backend,
        x: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_error_position";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.x.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.x.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary +
        MaybeNullableValue<Integer>, x> QueryFragment<crate::sqlite::Sqlite>
        for json_error_position<X, x> where
        x: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<x>(x);
    const _: () =
        {
            use diesel;
            impl<x, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<x> where
                x: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <x as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary +
        MaybeNullableValue<Integer>, x, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_error_position<X, x> where
        __Derived<x>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<x> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts a text value from a well-formed JSON document at the given path."]
#[doc = ""]
#[doc =
" Returns `NULL` if the path does not exist in the JSON document, or if the value at that"]
#[doc = " path is a JSON `null`."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc =
" - [`json_extract_integer`](json_extract_integer()) for integer values"]
#[doc =
" - [`json_extract_double`](json_extract_double()) for floating-point values"]
#[doc =
" - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": \"xyz\"});"]
#[doc =
" let result = diesel::select(json_extract_string::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = " assert_eq!(Some(\"xyz\".to_string()), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_string::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = " assert_eq!(Some(\"42\".to_string()), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_extract_string::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": \"xyz\"});"]
#[doc =
" let result = diesel::select(json_extract_string::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_extract_string<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text>(json: json, text: text)
    -> json_extract_string<J, json, text> where
    json: diesel::expression::AsExpression<J>,
    text: diesel::expression::AsExpression<Text> {
    json_extract_string_utils::json_extract_string {
        json: json.as_expression(),
        text: text.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_extract_string()`](fn@json_extract_string)"]
pub type json_extract_string<J, json, text> =
    json_extract_string_utils::json_extract_string<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_extract_string_return_type {
    #[doc =
    "Return type of the [`json_extract_string()`](fn@super::json_extract_string) SQL function."]
    pub type json_extract_string<json, text> =
        super::json_extract_string<<json as
        diesel::expression::Expression>::SqlType, json, text>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_extract_string_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_extract_string<J, json, text> {
        pub(in super) json: json,
        pub(in super) text: text,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text, __Rhs> ::core::ops::Add<__Rhs> for
                json_extract_string<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Sub<__Rhs> for
                json_extract_string<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Mul<__Rhs> for
                json_extract_string<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Div<__Rhs> for
                json_extract_string<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text: ::core::fmt::Debug> ::core::fmt::Debug for
        json_extract_string<J, json, text> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_extract_string", "json", &self.json, "text", &self.text,
                "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text: ::core::clone::Clone> ::core::clone::Clone for
        json_extract_string<J, json, text> {
        #[inline]
        fn clone(&self) -> json_extract_string<J, json, text> {
            json_extract_string {
                json: ::core::clone::Clone::clone(&self.json),
                text: ::core::clone::Clone::clone(&self.text),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text: ::core::marker::Copy> ::core::marker::Copy for
        json_extract_string<J, json, text> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_extract_string<J, json, text> {
                type QueryId =
                    json_extract_string<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <text as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc =
    "The return type of [`json_extract_string()`](fn@json_extract_string)"]
    pub type HelperType<J, json, text> =
        json_extract_string<J, <json as AsExpression<J>>::Expression,
        <text as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> Expression for json_extract_string<J, json, text> where
        (json, text): Expression {
        type SqlType = Nullable<Text>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_extract_string<J, json, text> where
        json: SelectableExpression<__DieselInternal>,
        text: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_extract_string<J, json, text> where
        json: AppearsOnTable<__DieselInternal>,
        text: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_extract_string<J, json, text> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> QueryFragment<crate::sqlite::Sqlite> for
        json_extract_string<J, json, text> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text>(json, text);
    const _: () =
        {
            use diesel;
            impl<json, text, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_extract_string<J, json, text> where
        __Derived<json, text>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts an integer value from a well-formed JSON document at the given path."]
#[doc = ""]
#[doc =
" Returns `NULL` if the path does not exist in the JSON document, or if the value at that"]
#[doc = " path is a JSON `null`."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc = " - [`json_extract_string`](json_extract_string()) for text values"]
#[doc =
" - [`json_extract_double`](json_extract_double()) for floating-point values"]
#[doc =
" - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(json_extract_integer::<Json, _, _>(json, \"$.c[2].f\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = " assert_eq!(Some(7), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 3.7});"]
#[doc =
" let result = diesel::select(json_extract_integer::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = " assert_eq!(Some(3), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_extract_integer::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2});"]
#[doc =
" let result = diesel::select(json_extract_integer::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_extract_integer<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text>(json: json, text: text)
    -> json_extract_integer<J, json, text> where
    json: diesel::expression::AsExpression<J>,
    text: diesel::expression::AsExpression<Text> {
    json_extract_integer_utils::json_extract_integer {
        json: json.as_expression(),
        text: text.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_extract_integer()`](fn@json_extract_integer)"]
pub type json_extract_integer<J, json, text> =
    json_extract_integer_utils::json_extract_integer<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_extract_integer_return_type {
    #[doc =
    "Return type of the [`json_extract_integer()`](fn@super::json_extract_integer) SQL function."]
    pub type json_extract_integer<json, text> =
        super::json_extract_integer<<json as
        diesel::expression::Expression>::SqlType, json, text>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_extract_integer_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_extract_integer<J, json, text> {
        pub(in super) json: json,
        pub(in super) text: text,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text, __Rhs> ::core::ops::Add<__Rhs> for
                json_extract_integer<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Sub<__Rhs> for
                json_extract_integer<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Mul<__Rhs> for
                json_extract_integer<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Div<__Rhs> for
                json_extract_integer<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text: ::core::fmt::Debug> ::core::fmt::Debug for
        json_extract_integer<J, json, text> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_extract_integer", "json", &self.json, "text",
                &self.text, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text: ::core::clone::Clone> ::core::clone::Clone for
        json_extract_integer<J, json, text> {
        #[inline]
        fn clone(&self) -> json_extract_integer<J, json, text> {
            json_extract_integer {
                json: ::core::clone::Clone::clone(&self.json),
                text: ::core::clone::Clone::clone(&self.text),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text: ::core::marker::Copy> ::core::marker::Copy for
        json_extract_integer<J, json, text> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_extract_integer<J, json, text> {
                type QueryId =
                    json_extract_integer<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <text as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc =
    "The return type of [`json_extract_integer()`](fn@json_extract_integer)"]
    pub type HelperType<J, json, text> =
        json_extract_integer<J, <json as AsExpression<J>>::Expression,
        <text as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> Expression for json_extract_integer<J, json, text> where
        (json, text): Expression {
        type SqlType = Nullable<Integer>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_extract_integer<J, json, text> where
        json: SelectableExpression<__DieselInternal>,
        text: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_extract_integer<J, json, text> where
        json: AppearsOnTable<__DieselInternal>,
        text: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_extract_integer<J, json, text> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> QueryFragment<crate::sqlite::Sqlite> for
        json_extract_integer<J, json, text> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text>(json, text);
    const _: () =
        {
            use diesel;
            impl<json, text, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_extract_integer<J, json, text> where
        __Derived<json, text>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts a floating-point value from a well-formed JSON document at the given path."]
#[doc = ""]
#[doc =
" Returns `NULL` if the path does not exist in the JSON document, or if the value at that"]
#[doc = " path is a JSON `null`."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc = " - [`json_extract_string`](json_extract_string()) for text values"]
#[doc =
" - [`json_extract_integer`](json_extract_integer()) for integer values"]
#[doc =
" - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 3.14});"]
#[doc =
" let result = diesel::select(json_extract_double::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<f64>>(connection)?;"]
#[doc = " assert_eq!(Some(3.14), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 7});"]
#[doc =
" let result = diesel::select(json_extract_double::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<f64>>(connection)?;"]
#[doc = " assert_eq!(Some(7.0), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_extract_double::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<f64>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 3.14});"]
#[doc =
" let result = diesel::select(json_extract_double::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<f64>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_extract_double<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text>(json: json, text: text)
    -> json_extract_double<J, json, text> where
    json: diesel::expression::AsExpression<J>,
    text: diesel::expression::AsExpression<Text> {
    json_extract_double_utils::json_extract_double {
        json: json.as_expression(),
        text: text.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_extract_double()`](fn@json_extract_double)"]
pub type json_extract_double<J, json, text> =
    json_extract_double_utils::json_extract_double<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_extract_double_return_type {
    #[doc =
    "Return type of the [`json_extract_double()`](fn@super::json_extract_double) SQL function."]
    pub type json_extract_double<json, text> =
        super::json_extract_double<<json as
        diesel::expression::Expression>::SqlType, json, text>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_extract_double_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_extract_double<J, json, text> {
        pub(in super) json: json,
        pub(in super) text: text,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text, __Rhs> ::core::ops::Add<__Rhs> for
                json_extract_double<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Sub<__Rhs> for
                json_extract_double<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Mul<__Rhs> for
                json_extract_double<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Div<__Rhs> for
                json_extract_double<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text: ::core::fmt::Debug> ::core::fmt::Debug for
        json_extract_double<J, json, text> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_extract_double", "json", &self.json, "text", &self.text,
                "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text: ::core::clone::Clone> ::core::clone::Clone for
        json_extract_double<J, json, text> {
        #[inline]
        fn clone(&self) -> json_extract_double<J, json, text> {
            json_extract_double {
                json: ::core::clone::Clone::clone(&self.json),
                text: ::core::clone::Clone::clone(&self.text),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text: ::core::marker::Copy> ::core::marker::Copy for
        json_extract_double<J, json, text> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_extract_double<J, json, text> {
                type QueryId =
                    json_extract_double<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <text as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc =
    "The return type of [`json_extract_double()`](fn@json_extract_double)"]
    pub type HelperType<J, json, text> =
        json_extract_double<J, <json as AsExpression<J>>::Expression,
        <text as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> Expression for json_extract_double<J, json, text> where
        (json, text): Expression {
        type SqlType = Nullable<Double>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_extract_double<J, json, text> where
        json: SelectableExpression<__DieselInternal>,
        text: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_extract_double<J, json, text> where
        json: AppearsOnTable<__DieselInternal>,
        text: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_extract_double<J, json, text> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> QueryFragment<crate::sqlite::Sqlite> for
        json_extract_double<J, json, text> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text>(json, text);
    const _: () =
        {
            use diesel;
            impl<json, text, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_extract_double<J, json, text> where
        __Derived<json, text>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts a JSON object or array from a well-formed JSON document at the given path."]
#[doc = ""]
#[doc =
" When a single path is provided, returns the value at that path as a [`Json`] value."]
#[doc =
" When multiple paths are provided (using the variadic form), returns a JSON array"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc =
"`json_extract_json_0`, `json_extract_json_1`, ... `json_extract_json_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_extract_json")]
#[doc = " containing the extracted values."]
#[doc = ""]
#[doc =
" Returns `NULL` if a single path does not exist in the JSON document. With multiple paths,"]
#[doc = " missing paths appear as `null` inside the returned JSON array."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc = " - [`json_extract_string`](json_extract_string()) for text values"]
#[doc =
" - [`json_extract_integer`](json_extract_integer()) for integer values"]
#[doc =
" - [`json_extract_double`](json_extract_double()) for floating-point values"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(json_extract_json_1::<Json, _, _>(json, \"$.c[2]\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"f\": 7})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5], \"f\": 7});"]
#[doc =
" let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, \"$.c\", \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([[4, 5], 2])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_json_1::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!(42)), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, \"$.a\", \"$.b\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([42, null])), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_extract_json_1::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_json_1::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, \"$.b\", \"$.c\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([null, null])), result);"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_extract_json_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text_1>(json: json, text_1: text_1)
    -> json_extract_json_1<J, json, text_1> where
    json: diesel::expression::AsExpression<J>,
    text_1: diesel::expression::AsExpression<Text> {
    json_extract_json_1_utils::json_extract_json_1 {
        json: json.as_expression(),
        text_1: text_1.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_extract_json_1()`](fn@json_extract_json_1)"]
pub type json_extract_json_1<J, json, text_1> =
    json_extract_json_1_utils::json_extract_json_1<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text_1 as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_extract_json_1_return_type {
    #[doc =
    "Return type of the [`json_extract_json_1()`](fn@super::json_extract_json_1) SQL function."]
    pub type json_extract_json_1<json, text_1> =
        super::json_extract_json_1<<json as
        diesel::expression::Expression>::SqlType, json, text_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_extract_json_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_extract_json_1<J, json, text_1> {
        pub(in super) json: json,
        pub(in super) text_1: text_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text_1, __Rhs> ::core::ops::Add<__Rhs> for
                json_extract_json_1<J, json, text_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, __Rhs> ::core::ops::Sub<__Rhs> for
                json_extract_json_1<J, json, text_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, __Rhs> ::core::ops::Mul<__Rhs> for
                json_extract_json_1<J, json, text_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, __Rhs> ::core::ops::Div<__Rhs> for
                json_extract_json_1<J, json, text_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text_1: ::core::fmt::Debug> ::core::fmt::Debug for
        json_extract_json_1<J, json, text_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_extract_json_1", "json", &self.json, "text_1",
                &self.text_1, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text_1: ::core::clone::Clone> ::core::clone::Clone for
        json_extract_json_1<J, json, text_1> {
        #[inline]
        fn clone(&self) -> json_extract_json_1<J, json, text_1> {
            json_extract_json_1 {
                json: ::core::clone::Clone::clone(&self.json),
                text_1: ::core::clone::Clone::clone(&self.text_1),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text_1: ::core::marker::Copy> ::core::marker::Copy for
        json_extract_json_1<J, json, text_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_extract_json_1<J, json, text_1> {
                type QueryId =
                    json_extract_json_1<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <text_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`json_extract_json_1()`](fn@json_extract_json_1)"]
    pub type HelperType<J, json, text_1> =
        json_extract_json_1<J, <json as AsExpression<J>>::Expression,
        <text_1 as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1> Expression for json_extract_json_1<J, json, text_1> where
        (json, text_1): Expression {
        type SqlType = Nullable<Json>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_extract_json_1<J, json, text_1> where
        json: SelectableExpression<__DieselInternal>,
        text_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_extract_json_1<J, json, text_1> where
        json: AppearsOnTable<__DieselInternal>,
        text_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_extract_json_1<J, json, text_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1> QueryFragment<crate::sqlite::Sqlite> for
        json_extract_json_1<J, json, text_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text_1>(json, text_1);
    const _: () =
        {
            use diesel;
            impl<json, text_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_extract_json_1<J, json, text_1> where
        __Derived<json, text_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts a JSON object or array from a well-formed JSON document at the given path."]
#[doc = ""]
#[doc =
" When a single path is provided, returns the value at that path as a [`Json`] value."]
#[doc =
" When multiple paths are provided (using the variadic form), returns a JSON array"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc =
"`json_extract_json_0`, `json_extract_json_1`, ... `json_extract_json_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_extract_json")]
#[doc = " containing the extracted values."]
#[doc = ""]
#[doc =
" Returns `NULL` if a single path does not exist in the JSON document. With multiple paths,"]
#[doc = " missing paths appear as `null` inside the returned JSON array."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc = " - [`json_extract_string`](json_extract_string()) for text values"]
#[doc =
" - [`json_extract_integer`](json_extract_integer()) for integer values"]
#[doc =
" - [`json_extract_double`](json_extract_double()) for floating-point values"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(json_extract_json_1::<Json, _, _>(json, \"$.c[2]\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"f\": 7})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5], \"f\": 7});"]
#[doc =
" let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, \"$.c\", \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([[4, 5], 2])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_json_1::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!(42)), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, \"$.a\", \"$.b\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([42, null])), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_extract_json_1::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_json_1::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, \"$.b\", \"$.c\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([null, null])), result);"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_extract_json_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text_1,
    text_2>(json: json, text_1: text_1, text_2: text_2)
    -> json_extract_json_2<J, json, text_1, text_2> where
    json: diesel::expression::AsExpression<J>,
    text_1: diesel::expression::AsExpression<Text>,
    text_2: diesel::expression::AsExpression<Text> {
    json_extract_json_2_utils::json_extract_json_2 {
        json: json.as_expression(),
        text_1: text_1.as_expression(),
        text_2: text_2.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_extract_json_2()`](fn@json_extract_json_2)"]
pub type json_extract_json_2<J, json, text_1, text_2> =
    json_extract_json_2_utils::json_extract_json_2<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text_1 as diesel::expression::AsExpression<Text>>::Expression,
    <text_2 as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_extract_json_2_return_type {
    #[doc =
    "Return type of the [`json_extract_json_2()`](fn@super::json_extract_json_2) SQL function."]
    pub type json_extract_json_2<json, text_1, text_2> =
        super::json_extract_json_2<<json as
        diesel::expression::Expression>::SqlType, json, text_1, text_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_extract_json_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_extract_json_2<J, json, text_1, text_2> {
        pub(in super) json: json,
        pub(in super) text_1: text_1,
        pub(in super) text_2: text_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text_1, text_2, __Rhs> ::core::ops::Add<__Rhs> for
                json_extract_json_2<J, json, text_1, text_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, text_2, __Rhs> ::core::ops::Sub<__Rhs> for
                json_extract_json_2<J, json, text_1, text_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, text_2, __Rhs> ::core::ops::Mul<__Rhs> for
                json_extract_json_2<J, json, text_1, text_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, text_2, __Rhs> ::core::ops::Div<__Rhs> for
                json_extract_json_2<J, json, text_1, text_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text_1: ::core::fmt::Debug, text_2: ::core::fmt::Debug>
        ::core::fmt::Debug for json_extract_json_2<J, json, text_1, text_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "json_extract_json_2", "json", &self.json, "text_1",
                &self.text_1, "text_2", &self.text_2, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text_1: ::core::clone::Clone, text_2: ::core::clone::Clone>
        ::core::clone::Clone for json_extract_json_2<J, json, text_1, text_2>
        {
        #[inline]
        fn clone(&self) -> json_extract_json_2<J, json, text_1, text_2> {
            json_extract_json_2 {
                json: ::core::clone::Clone::clone(&self.json),
                text_1: ::core::clone::Clone::clone(&self.text_1),
                text_2: ::core::clone::Clone::clone(&self.text_2),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text_1: ::core::marker::Copy, text_2: ::core::marker::Copy>
        ::core::marker::Copy for json_extract_json_2<J, json, text_1, text_2>
        {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text_1: diesel::query_builder::QueryId,
                text_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_extract_json_2<J, json, text_1, text_2> {
                type QueryId =
                    json_extract_json_2<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text_1 as diesel::query_builder::QueryId>::QueryId,
                    <text_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <text_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <text_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <text_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`json_extract_json_2()`](fn@json_extract_json_2)"]
    pub type HelperType<J, json, text_1, text_2> =
        json_extract_json_2<J, <json as AsExpression<J>>::Expression,
        <text_1 as AsExpression<Text>>::Expression,
        <text_2 as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2> Expression for
        json_extract_json_2<J, json, text_1, text_2> where
        (json, text_1, text_2): Expression {
        type SqlType = Nullable<Json>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_extract_json_2<J, json, text_1, text_2> where
        json: SelectableExpression<__DieselInternal>,
        text_1: SelectableExpression<__DieselInternal>,
        text_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_extract_json_2<J, json, text_1, text_2> where
        json: AppearsOnTable<__DieselInternal>,
        text_1: AppearsOnTable<__DieselInternal>,
        text_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2, __DieselInternal> FunctionFragment<__DieselInternal>
        for json_extract_json_2<J, json, text_1, text_2> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text_1: QueryFragment<__DieselInternal>,
        text_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2> QueryFragment<crate::sqlite::Sqlite> for
        json_extract_json_2<J, json, text_1, text_2> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text_1: QueryFragment<crate::sqlite::Sqlite>,
        text_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text_1, text_2>(json, text_1, text_2);
    const _: () =
        {
            use diesel;
            impl<json, text_1, text_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text_1, text_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text_1: diesel::expression::ValidGrouping<__GroupByClause>,
                text_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<text_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<text_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<text_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_extract_json_2<J, json, text_1, text_2> where
        __Derived<json, text_1, text_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text_1, text_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __json_extract_json_return_types {
    #[doc(inline)]
    pub use super::__json_extract_json_1_return_type::*;
    #[doc(inline)]
    pub use super::__json_extract_json_2_return_type::*;
}
#[doc =
" Extracts a text value from a well-formed JSON or JSONB document at the given path."]
#[doc = ""]
#[doc =
" Works identically to [`json_extract_string`](json_extract_string()) for scalar text values."]
#[doc = ""]
#[doc =
" Returns `NULL` if the path does not exist in the JSON document, or if the value at that"]
#[doc = " path is a JSON `null`."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc =
" - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values"]
#[doc =
" - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values"]
#[doc =
" - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": \"xyz\"});"]
#[doc =
" let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = " assert_eq!(Some(\"xyz\".to_string()), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 42});"]
#[doc =
" let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = " assert_eq!(Some(\"42\".to_string()), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_extract_string::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": \"xyz\"});"]
#[doc =
" let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_extract_string<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text>(json: json, text: text)
    -> jsonb_extract_string<J, json, text> where
    json: diesel::expression::AsExpression<J>,
    text: diesel::expression::AsExpression<Text> {
    jsonb_extract_string_utils::jsonb_extract_string {
        json: json.as_expression(),
        text: text.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`jsonb_extract_string()`](fn@jsonb_extract_string)"]
pub type jsonb_extract_string<J, json, text> =
    jsonb_extract_string_utils::jsonb_extract_string<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_extract_string_return_type {
    #[doc =
    "Return type of the [`jsonb_extract_string()`](fn@super::jsonb_extract_string) SQL function."]
    pub type jsonb_extract_string<json, text> =
        super::jsonb_extract_string<<json as
        diesel::expression::Expression>::SqlType, json, text>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_extract_string_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_extract_string<J, json, text> {
        pub(in super) json: json,
        pub(in super) text: text,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_extract_string<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_extract_string<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_extract_string<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_extract_string<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb_extract_string<J, json, text> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "jsonb_extract_string", "json", &self.json, "text",
                &self.text, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text: ::core::clone::Clone> ::core::clone::Clone for
        jsonb_extract_string<J, json, text> {
        #[inline]
        fn clone(&self) -> jsonb_extract_string<J, json, text> {
            jsonb_extract_string {
                json: ::core::clone::Clone::clone(&self.json),
                text: ::core::clone::Clone::clone(&self.text),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text: ::core::marker::Copy> ::core::marker::Copy for
        jsonb_extract_string<J, json, text> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_extract_string<J, json, text> {
                type QueryId =
                    jsonb_extract_string<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <text as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc =
    "The return type of [`jsonb_extract_string()`](fn@jsonb_extract_string)"]
    pub type HelperType<J, json, text> =
        jsonb_extract_string<J, <json as AsExpression<J>>::Expression,
        <text as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> Expression for jsonb_extract_string<J, json, text> where
        (json, text): Expression {
        type SqlType = Nullable<Text>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_extract_string<J, json, text> where
        json: SelectableExpression<__DieselInternal>,
        text: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_extract_string<J, json, text> where
        json: AppearsOnTable<__DieselInternal>,
        text: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_extract_string<J, json, text> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_extract_string<J, json, text> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text>(json, text);
    const _: () =
        {
            use diesel;
            impl<json, text, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_extract_string<J, json, text> where
        __Derived<json, text>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts an integer value from a well-formed JSON or JSONB document at the given path."]
#[doc = ""]
#[doc =
" Works identically to [`json_extract_integer`](json_extract_integer()) for integer values."]
#[doc = ""]
#[doc =
" Returns `NULL` if the path does not exist in the JSON document, or if the value at that"]
#[doc = " path is a JSON `null`."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc = " - [`jsonb_extract_string`](jsonb_extract_string()) for text values"]
#[doc =
" - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values"]
#[doc =
" - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, \"$.c[2].f\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = " assert_eq!(Some(7), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 3.7});"]
#[doc =
" let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = " assert_eq!(Some(3), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_extract_integer::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2});"]
#[doc =
" let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<i32>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_extract_integer<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text>(json: json, text: text)
    -> jsonb_extract_integer<J, json, text> where
    json: diesel::expression::AsExpression<J>,
    text: diesel::expression::AsExpression<Text> {
    jsonb_extract_integer_utils::jsonb_extract_integer {
        json: json.as_expression(),
        text: text.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`jsonb_extract_integer()`](fn@jsonb_extract_integer)"]
pub type jsonb_extract_integer<J, json, text> =
    jsonb_extract_integer_utils::jsonb_extract_integer<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_extract_integer_return_type {
    #[doc =
    "Return type of the [`jsonb_extract_integer()`](fn@super::jsonb_extract_integer) SQL function."]
    pub type jsonb_extract_integer<json, text> =
        super::jsonb_extract_integer<<json as
        diesel::expression::Expression>::SqlType, json, text>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_extract_integer_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_extract_integer<J, json, text> {
        pub(in super) json: json,
        pub(in super) text: text,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_extract_integer<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_extract_integer<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_extract_integer<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_extract_integer<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb_extract_integer<J, json, text> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "jsonb_extract_integer", "json", &self.json, "text",
                &self.text, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text: ::core::clone::Clone> ::core::clone::Clone for
        jsonb_extract_integer<J, json, text> {
        #[inline]
        fn clone(&self) -> jsonb_extract_integer<J, json, text> {
            jsonb_extract_integer {
                json: ::core::clone::Clone::clone(&self.json),
                text: ::core::clone::Clone::clone(&self.text),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text: ::core::marker::Copy> ::core::marker::Copy for
        jsonb_extract_integer<J, json, text> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_extract_integer<J, json, text> {
                type QueryId =
                    jsonb_extract_integer<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <text as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc =
    "The return type of [`jsonb_extract_integer()`](fn@jsonb_extract_integer)"]
    pub type HelperType<J, json, text> =
        jsonb_extract_integer<J, <json as AsExpression<J>>::Expression,
        <text as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> Expression for jsonb_extract_integer<J, json, text> where
        (json, text): Expression {
        type SqlType = Nullable<Integer>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_extract_integer<J, json, text> where
        json: SelectableExpression<__DieselInternal>,
        text: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_extract_integer<J, json, text> where
        json: AppearsOnTable<__DieselInternal>,
        text: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_extract_integer<J, json, text> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_extract_integer<J, json, text> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text>(json, text);
    const _: () =
        {
            use diesel;
            impl<json, text, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_extract_integer<J, json, text> where
        __Derived<json, text>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts a floating-point value from a well-formed JSON or JSONB document at the given path."]
#[doc = ""]
#[doc =
" Works identically to [`json_extract_double`](json_extract_double()) for floating-point values."]
#[doc = ""]
#[doc =
" Returns `NULL` if the path does not exist in the JSON document, or if the value at that"]
#[doc = " path is a JSON `null`."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc = " - [`jsonb_extract_string`](jsonb_extract_string()) for text values"]
#[doc =
" - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values"]
#[doc =
" - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 3.14});"]
#[doc =
" let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<f64>>(connection)?;"]
#[doc = " assert_eq!(Some(3.14), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 7});"]
#[doc =
" let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<f64>>(connection)?;"]
#[doc = " assert_eq!(Some(7.0), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_extract_double::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<f64>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 3.14});"]
#[doc =
" let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<f64>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_extract_double<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text>(json: json, text: text)
    -> jsonb_extract_double<J, json, text> where
    json: diesel::expression::AsExpression<J>,
    text: diesel::expression::AsExpression<Text> {
    jsonb_extract_double_utils::jsonb_extract_double {
        json: json.as_expression(),
        text: text.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`jsonb_extract_double()`](fn@jsonb_extract_double)"]
pub type jsonb_extract_double<J, json, text> =
    jsonb_extract_double_utils::jsonb_extract_double<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_extract_double_return_type {
    #[doc =
    "Return type of the [`jsonb_extract_double()`](fn@super::jsonb_extract_double) SQL function."]
    pub type jsonb_extract_double<json, text> =
        super::jsonb_extract_double<<json as
        diesel::expression::Expression>::SqlType, json, text>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_extract_double_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_extract_double<J, json, text> {
        pub(in super) json: json,
        pub(in super) text: text,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_extract_double<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_extract_double<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_extract_double<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_extract_double<J, json, text> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb_extract_double<J, json, text> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "jsonb_extract_double", "json", &self.json, "text",
                &self.text, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text: ::core::clone::Clone> ::core::clone::Clone for
        jsonb_extract_double<J, json, text> {
        #[inline]
        fn clone(&self) -> jsonb_extract_double<J, json, text> {
            jsonb_extract_double {
                json: ::core::clone::Clone::clone(&self.json),
                text: ::core::clone::Clone::clone(&self.text),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text: ::core::marker::Copy> ::core::marker::Copy for
        jsonb_extract_double<J, json, text> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_extract_double<J, json, text> {
                type QueryId =
                    jsonb_extract_double<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <text as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc =
    "The return type of [`jsonb_extract_double()`](fn@jsonb_extract_double)"]
    pub type HelperType<J, json, text> =
        jsonb_extract_double<J, <json as AsExpression<J>>::Expression,
        <text as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> Expression for jsonb_extract_double<J, json, text> where
        (json, text): Expression {
        type SqlType = Nullable<Double>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_extract_double<J, json, text> where
        json: SelectableExpression<__DieselInternal>,
        text: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_extract_double<J, json, text> where
        json: AppearsOnTable<__DieselInternal>,
        text: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_extract_double<J, json, text> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_extract_double<J, json, text> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text>(json, text);
    const _: () =
        {
            use diesel;
            impl<json, text, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_extract_double<J, json, text> where
        __Derived<json, text>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts a JSON object or array from a well-formed JSON or JSONB document at the given path,"]
#[doc = " returning it in JSONB format."]
#[doc = ""]
#[doc =
" Unlike [`json_extract_json`](json_extract_json_1()), which returns JSON objects and arrays"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc =
"`jsonb_extract_jsonb_0`, `jsonb_extract_jsonb_1`, ... `jsonb_extract_jsonb_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_extract_jsonb")]
#[doc =
" as text, this function returns them in the internal JSONB binary format. For scalar values"]
#[doc = " (text, integer, double, null), both functions behave identically."]
#[doc = ""]
#[doc =
" When a single path is provided, returns the value at that path as a [`Jsonb`] value."]
#[doc =
" When multiple paths are provided (using the variadic form), returns a JSONB array"]
#[doc = " containing the extracted values."]
#[doc = ""]
#[doc =
" Returns `NULL` if a single path does not exist in the JSON document. With multiple paths,"]
#[doc = " missing paths appear as `null` inside the returned JSONB array."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc = " - [`jsonb_extract_string`](jsonb_extract_string()) for text values"]
#[doc =
" - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values"]
#[doc =
" - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Jsonb, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, \"$\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc =
" assert_eq!(Some(json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, \"$.c\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([4, 5, {\"f\": 7}])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, \"$.c[2]\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"f\": 7})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, \"$.c\", \"$.x\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([[4, 5], null])), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5], \"f\": 7});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, \"$.c\", \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([[4, 5], 2])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, \"$.b\", \"$.c\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([null, null])), result);"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_extract_jsonb_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text_1>(json: json, text_1: text_1)
    -> jsonb_extract_jsonb_1<J, json, text_1> where
    json: diesel::expression::AsExpression<J>,
    text_1: diesel::expression::AsExpression<Text> {
    jsonb_extract_jsonb_1_utils::jsonb_extract_jsonb_1 {
        json: json.as_expression(),
        text_1: text_1.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`jsonb_extract_jsonb_1()`](fn@jsonb_extract_jsonb_1)"]
pub type jsonb_extract_jsonb_1<J, json, text_1> =
    jsonb_extract_jsonb_1_utils::jsonb_extract_jsonb_1<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text_1 as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_extract_jsonb_1_return_type {
    #[doc =
    "Return type of the [`jsonb_extract_jsonb_1()`](fn@super::jsonb_extract_jsonb_1) SQL function."]
    pub type jsonb_extract_jsonb_1<json, text_1> =
        super::jsonb_extract_jsonb_1<<json as
        diesel::expression::Expression>::SqlType, json, text_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_extract_jsonb_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_extract_jsonb_1<J, json, text_1> {
        pub(in super) json: json,
        pub(in super) text_1: text_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text_1, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_extract_jsonb_1<J, json, text_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_extract_jsonb_1<J, json, text_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_extract_jsonb_1<J, json, text_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_extract_jsonb_1<J, json, text_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text_1: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb_extract_jsonb_1<J, json, text_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "jsonb_extract_jsonb_1", "json", &self.json, "text_1",
                &self.text_1, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text_1: ::core::clone::Clone> ::core::clone::Clone for
        jsonb_extract_jsonb_1<J, json, text_1> {
        #[inline]
        fn clone(&self) -> jsonb_extract_jsonb_1<J, json, text_1> {
            jsonb_extract_jsonb_1 {
                json: ::core::clone::Clone::clone(&self.json),
                text_1: ::core::clone::Clone::clone(&self.text_1),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text_1: ::core::marker::Copy> ::core::marker::Copy for
        jsonb_extract_jsonb_1<J, json, text_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_extract_jsonb_1<J, json, text_1> {
                type QueryId =
                    jsonb_extract_jsonb_1<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <text_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`jsonb_extract_jsonb_1()`](fn@jsonb_extract_jsonb_1)"]
    pub type HelperType<J, json, text_1> =
        jsonb_extract_jsonb_1<J, <json as AsExpression<J>>::Expression,
        <text_1 as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1> Expression for jsonb_extract_jsonb_1<J, json, text_1> where
        (json, text_1): Expression {
        type SqlType = Nullable<Jsonb>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_extract_jsonb_1<J, json, text_1> where
        json: SelectableExpression<__DieselInternal>,
        text_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_extract_jsonb_1<J, json, text_1> where
        json: AppearsOnTable<__DieselInternal>,
        text_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_extract_jsonb_1<J, json, text_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_extract_jsonb_1<J, json, text_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text_1>(json, text_1);
    const _: () =
        {
            use diesel;
            impl<json, text_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_extract_jsonb_1<J, json, text_1> where
        __Derived<json, text_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Extracts a JSON object or array from a well-formed JSON or JSONB document at the given path,"]
#[doc = " returning it in JSONB format."]
#[doc = ""]
#[doc =
" Unlike [`json_extract_json`](json_extract_json_1()), which returns JSON objects and arrays"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc =
"`jsonb_extract_jsonb_0`, `jsonb_extract_jsonb_1`, ... `jsonb_extract_jsonb_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_extract_jsonb")]
#[doc =
" as text, this function returns them in the internal JSONB binary format. For scalar values"]
#[doc = " (text, integer, double, null), both functions behave identically."]
#[doc = ""]
#[doc =
" When a single path is provided, returns the value at that path as a [`Jsonb`] value."]
#[doc =
" When multiple paths are provided (using the variadic form), returns a JSONB array"]
#[doc = " containing the extracted values."]
#[doc = ""]
#[doc =
" Returns `NULL` if a single path does not exist in the JSON document. With multiple paths,"]
#[doc = " missing paths appear as `null` inside the returned JSONB array."]
#[doc = ""]
#[doc = " To extract other types, use:"]
#[doc = " - [`jsonb_extract_string`](jsonb_extract_string()) for text values"]
#[doc =
" - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values"]
#[doc =
" - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.9 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Jsonb, Nullable};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 9, 0);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, \"$\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc =
" assert_eq!(Some(json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, \"$.c\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([4, 5, {\"f\": 7}])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, \"$.c[2]\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"f\": 7})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, \"$.c\", \"$.x\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([[4, 5], null])), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Nullable<Json>, _, _>(None::<Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5, {\"f\": 7}]});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, \"$.x\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2, \"c\": [4, 5], \"f\": 7});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, \"$.c\", \"$.a\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([[4, 5], 2])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 2});"]
#[doc =
" let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, \"$.b\", \"$.c\"))"]
#[doc = "     .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([null, null])), result);"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_extract_jsonb_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, text_1,
    text_2>(json: json, text_1: text_1, text_2: text_2)
    -> jsonb_extract_jsonb_2<J, json, text_1, text_2> where
    json: diesel::expression::AsExpression<J>,
    text_1: diesel::expression::AsExpression<Text>,
    text_2: diesel::expression::AsExpression<Text> {
    jsonb_extract_jsonb_2_utils::jsonb_extract_jsonb_2 {
        json: json.as_expression(),
        text_1: text_1.as_expression(),
        text_2: text_2.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`jsonb_extract_jsonb_2()`](fn@jsonb_extract_jsonb_2)"]
pub type jsonb_extract_jsonb_2<J, json, text_1, text_2> =
    jsonb_extract_jsonb_2_utils::jsonb_extract_jsonb_2<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <text_1 as diesel::expression::AsExpression<Text>>::Expression,
    <text_2 as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_extract_jsonb_2_return_type {
    #[doc =
    "Return type of the [`jsonb_extract_jsonb_2()`](fn@super::jsonb_extract_jsonb_2) SQL function."]
    pub type jsonb_extract_jsonb_2<json, text_1, text_2> =
        super::jsonb_extract_jsonb_2<<json as
        diesel::expression::Expression>::SqlType, json, text_1, text_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_extract_jsonb_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_extract_jsonb_2<J, json, text_1, text_2> {
        pub(in super) json: json,
        pub(in super) text_1: text_1,
        pub(in super) text_2: text_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, text_1, text_2, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_extract_jsonb_2<J, json, text_1, text_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, text_2, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_extract_jsonb_2<J, json, text_1, text_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, text_2, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_extract_jsonb_2<J, json, text_1, text_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, text_1, text_2, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_extract_jsonb_2<J, json, text_1, text_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        text_1: ::core::fmt::Debug, text_2: ::core::fmt::Debug>
        ::core::fmt::Debug for jsonb_extract_jsonb_2<J, json, text_1, text_2>
        {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "jsonb_extract_jsonb_2", "json", &self.json, "text_1",
                &self.text_1, "text_2", &self.text_2, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        text_1: ::core::clone::Clone, text_2: ::core::clone::Clone>
        ::core::clone::Clone for
        jsonb_extract_jsonb_2<J, json, text_1, text_2> {
        #[inline]
        fn clone(&self) -> jsonb_extract_jsonb_2<J, json, text_1, text_2> {
            jsonb_extract_jsonb_2 {
                json: ::core::clone::Clone::clone(&self.json),
                text_1: ::core::clone::Clone::clone(&self.text_1),
                text_2: ::core::clone::Clone::clone(&self.text_2),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        text_1: ::core::marker::Copy, text_2: ::core::marker::Copy>
        ::core::marker::Copy for
        jsonb_extract_jsonb_2<J, json, text_1, text_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                text_1: diesel::query_builder::QueryId,
                text_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_extract_jsonb_2<J, json, text_1, text_2> {
                type QueryId =
                    jsonb_extract_jsonb_2<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <text_1 as diesel::query_builder::QueryId>::QueryId,
                    <text_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <text_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <text_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <text_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <text_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`jsonb_extract_jsonb_2()`](fn@jsonb_extract_jsonb_2)"]
    pub type HelperType<J, json, text_1, text_2> =
        jsonb_extract_jsonb_2<J, <json as AsExpression<J>>::Expression,
        <text_1 as AsExpression<Text>>::Expression,
        <text_2 as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2> Expression for
        jsonb_extract_jsonb_2<J, json, text_1, text_2> where
        (json, text_1, text_2): Expression {
        type SqlType = Nullable<Jsonb>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_extract_jsonb_2<J, json, text_1, text_2> where
        json: SelectableExpression<__DieselInternal>,
        text_1: SelectableExpression<__DieselInternal>,
        text_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_extract_jsonb_2<J, json, text_1, text_2> where
        json: AppearsOnTable<__DieselInternal>,
        text_1: AppearsOnTable<__DieselInternal>,
        text_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2, __DieselInternal> FunctionFragment<__DieselInternal>
        for jsonb_extract_jsonb_2<J, json, text_1, text_2> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        text_1: QueryFragment<__DieselInternal>,
        text_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_extract";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.text_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.text_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_extract_jsonb_2<J, json, text_1, text_2> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        text_1: QueryFragment<crate::sqlite::Sqlite>,
        text_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, text_1, text_2>(json, text_1, text_2);
    const _: () =
        {
            use diesel;
            impl<json, text_1, text_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, text_1, text_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                text_1: diesel::expression::ValidGrouping<__GroupByClause>,
                text_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<text_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<text_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<text_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<text_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<text_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        text_1, text_2, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_extract_jsonb_2<J, json, text_1, text_2> where
        __Derived<json, text_1, text_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, text_1, text_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __jsonb_extract_jsonb_return_types {
    #[doc(inline)]
    pub use super::__jsonb_extract_jsonb_1_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_extract_jsonb_2_return_type::*;
}
#[doc = " Converts the given json value to pretty-printed, indented text"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.46 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_pretty};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 46, 0);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty::<Json, _>(json!([{\"f1\":1,\"f2\":null},2,null,3])))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"["]
#[doc = "     {"]
#[doc = "         \"f1\": 1,"]
#[doc = "         \"f2\": null"]
#[doc = "     },"]
#[doc = "     2,"]
#[doc = "     null,"]
#[doc = "     3"]
#[doc = " ]\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty::<Json, _>(json!({\"a\": 1, \"b\": \"cd\"})))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"{"]
#[doc = "     \"a\": 1,"]
#[doc = "     \"b\": \"cd\""]
#[doc = " }\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty::<Json, _>(json!(\"abc\")))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"\"abc\"\"#, result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_pretty::<Json, _>(json!(22)))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"22\"#, result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_pretty::<Json, _>(json!(false)))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"false\"#, result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_pretty::<Json, _>(json!(null)))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"null\"#, result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_pretty::<Json, _>(json!({})))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"{}\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty::<Nullable<Json>, _>(None::<Value>))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty::<Jsonb, _>(json!([{\"f1\":1,\"f2\":null},2,null,3])))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"["]
#[doc = "     {"]
#[doc = "         \"f1\": 1,"]
#[doc = "         \"f2\": null"]
#[doc = "     },"]
#[doc = "     2,"]
#[doc = "     null,"]
#[doc = "     3"]
#[doc = " ]\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty::<Jsonb, _>(json!({\"a\": 1, \"b\": \"cd\"})))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"{"]
#[doc = "     \"a\": 1,"]
#[doc = "     \"b\": \"cd\""]
#[doc = " }\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty::<Jsonb, _>(json!(\"abc\")))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"\"abc\"\"#, result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_pretty::<Jsonb, _>(json!(22)))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"22\"#, result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_pretty::<Jsonb, _>(json!(false)))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"false\"#, result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_pretty::<Jsonb, _>(json!(null)))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"null\"#, result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_pretty::<Jsonb, _>(json!({})))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"{}\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty::<Nullable<Jsonb>, _>(None::<Value>))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert!(result.is_none());"]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_pretty<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Text>, j>(j: j) -> json_pretty<J, j> where
    j: diesel::expression::AsExpression<J> {
    json_pretty_utils::json_pretty {
        j: j.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_pretty()`](fn@json_pretty)"]
pub type json_pretty<J, j> =
    json_pretty_utils::json_pretty<J,
    <j as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_pretty_return_type {
    #[doc =
    "Return type of the [`json_pretty()`](fn@super::json_pretty) SQL function."]
    pub type json_pretty<j> =
        super::json_pretty<<j as diesel::expression::Expression>::SqlType, j>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_pretty_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_pretty<J, j> {
        pub(in super) j: j,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, j, __Rhs> ::core::ops::Add<__Rhs> for json_pretty<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Sub<__Rhs> for json_pretty<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Mul<__Rhs> for json_pretty<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Div<__Rhs> for json_pretty<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, j: ::core::fmt::Debug> ::core::fmt::Debug for
        json_pretty<J, j> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_pretty", "j", &self.j, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, j: ::core::clone::Clone>
        ::core::clone::Clone for json_pretty<J, j> {
        #[inline]
        fn clone(&self) -> json_pretty<J, j> {
            json_pretty {
                j: ::core::clone::Clone::clone(&self.j),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, j: ::core::marker::Copy>
        ::core::marker::Copy for json_pretty<J, j> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                j: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_pretty<J, j> {
                type QueryId =
                    json_pretty<<J as diesel::query_builder::QueryId>::QueryId,
                    <j as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <j as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        && true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <j as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_pretty()`](fn@json_pretty)"]
    pub type HelperType<J, j> =
        json_pretty<J, <j as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j> Expression for json_pretty<J, j> where
        (j): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_pretty<J, j> where
        j: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_pretty<J, j> where
        j: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_pretty<J, j> where
        __DieselInternal: diesel::backend::Backend,
        j: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_pretty";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.j.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.j.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j> QueryFragment<crate::sqlite::Sqlite> for
        json_pretty<J, j> where j: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<j>(j);
    const _: () =
        {
            use diesel;
            impl<j, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<j> where
                j: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <j as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_pretty<J, j> where
        __Derived<j>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<j> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc = " Converts the given json value to pretty-printed, indented text"]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.46 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_pretty_with_indentation};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 46, 0);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!([{\"f1\":1,\"f2\":null},2,null,3]), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"["]
#[doc = "   {"]
#[doc = "     \"f1\": 1,"]
#[doc = "     \"f2\": null"]
#[doc = "   },"]
#[doc = "   2,"]
#[doc = "   null,"]
#[doc = "   3"]
#[doc = " ]\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!([{\"f1\":1,\"f2\":null},2,null,3]), None::<&str>))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"["]
#[doc = "     {"]
#[doc = "         \"f1\": 1,"]
#[doc = "         \"f2\": null"]
#[doc = "     },"]
#[doc = "     2,"]
#[doc = "     null,"]
#[doc = "     3"]
#[doc = " ]\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!({\"a\": 1, \"b\": \"cd\"}), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"{"]
#[doc = "   \"a\": 1,"]
#[doc = "   \"b\": \"cd\""]
#[doc = " }\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(\"abc\"), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"\"abc\"\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(22), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"22\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(false), None::<&str>))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"false\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(null), None::<&str>))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"null\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!({}), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"{}\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Nullable<Json>, _, _>(None::<Value>, None::<&str>))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!([{\"f1\":1,\"f2\":null},2,null,3]), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"["]
#[doc = "   {"]
#[doc = "     \"f1\": 1,"]
#[doc = "     \"f2\": null"]
#[doc = "   },"]
#[doc = "   2,"]
#[doc = "   null,"]
#[doc = "   3"]
#[doc = " ]\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!([{\"f1\":1,\"f2\":null},2,null,3]), None::<&str>))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"["]
#[doc = "     {"]
#[doc = "         \"f1\": 1,"]
#[doc = "         \"f2\": null"]
#[doc = "     },"]
#[doc = "     2,"]
#[doc = "     null,"]
#[doc = "     3"]
#[doc = " ]\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!({\"a\": 1, \"b\": \"cd\"}), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"{"]
#[doc = "   \"a\": 1,"]
#[doc = "   \"b\": \"cd\""]
#[doc = " }\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(\"abc\"), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"\"abc\"\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(22), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"22\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(false), None::<&str>))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"false\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(null), None::<&str>))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"null\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!({}), \"  \"))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(r#\"{}\"#, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_pretty_with_indentation::<Nullable<Jsonb>, _, _>(None::<Value>, None::<&str>))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_pretty_with_indentation<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Text>, j, indentation>(j: j, indentation: indentation)
    -> json_pretty_with_indentation<J, j, indentation> where
    j: diesel::expression::AsExpression<J>,
    indentation: diesel::expression::AsExpression<Nullable<Text>> {
    json_pretty_with_indentation_utils::json_pretty_with_indentation {
        j: j.as_expression(),
        indentation: indentation.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_pretty_with_indentation()`](fn@json_pretty_with_indentation)"]
pub type json_pretty_with_indentation<J, j, indentation> =
    json_pretty_with_indentation_utils::json_pretty_with_indentation<J,
    <j as diesel::expression::AsExpression<J>>::Expression,
    <indentation as
    diesel::expression::AsExpression<Nullable<Text>>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_pretty_with_indentation_return_type {
    #[doc =
    "Return type of the [`json_pretty_with_indentation()`](fn@super::json_pretty_with_indentation) SQL function."]
    pub type json_pretty_with_indentation<j, indentation> =
        super::json_pretty_with_indentation<<j as
        diesel::expression::Expression>::SqlType, j, indentation>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_pretty_with_indentation_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_pretty_with_indentation<J, j, indentation> {
        pub(in super) j: j,
        pub(in super) indentation: indentation,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, j, indentation, __Rhs> ::core::ops::Add<__Rhs> for
                json_pretty_with_indentation<J, j, indentation> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, j, indentation, __Rhs> ::core::ops::Sub<__Rhs> for
                json_pretty_with_indentation<J, j, indentation> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, j, indentation, __Rhs> ::core::ops::Mul<__Rhs> for
                json_pretty_with_indentation<J, j, indentation> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, j, indentation, __Rhs> ::core::ops::Div<__Rhs> for
                json_pretty_with_indentation<J, j, indentation> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, j: ::core::fmt::Debug,
        indentation: ::core::fmt::Debug> ::core::fmt::Debug for
        json_pretty_with_indentation<J, j, indentation> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_pretty_with_indentation", "j", &self.j, "indentation",
                &self.indentation, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, j: ::core::clone::Clone,
        indentation: ::core::clone::Clone> ::core::clone::Clone for
        json_pretty_with_indentation<J, j, indentation> {
        #[inline]
        fn clone(&self) -> json_pretty_with_indentation<J, j, indentation> {
            json_pretty_with_indentation {
                j: ::core::clone::Clone::clone(&self.j),
                indentation: ::core::clone::Clone::clone(&self.indentation),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, j: ::core::marker::Copy,
        indentation: ::core::marker::Copy> ::core::marker::Copy for
        json_pretty_with_indentation<J, j, indentation> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                j: diesel::query_builder::QueryId,
                indentation: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_pretty_with_indentation<J, j, indentation> {
                type QueryId =
                    json_pretty_with_indentation<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <j as diesel::query_builder::QueryId>::QueryId,
                    <indentation as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <j as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <indentation as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <j as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <indentation as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`json_pretty_with_indentation()`](fn@json_pretty_with_indentation)"]
    pub type HelperType<J, j, indentation> =
        json_pretty_with_indentation<J, <j as AsExpression<J>>::Expression,
        <indentation as AsExpression<Nullable<Text>>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, indentation> Expression for
        json_pretty_with_indentation<J, j, indentation> where
        (j, indentation): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, indentation, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_pretty_with_indentation<J, j, indentation> where
        j: SelectableExpression<__DieselInternal>,
        indentation: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, indentation, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        json_pretty_with_indentation<J, j, indentation> where
        j: AppearsOnTable<__DieselInternal>,
        indentation: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, indentation, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        json_pretty_with_indentation<J, j, indentation> where
        __DieselInternal: diesel::backend::Backend,
        j: QueryFragment<__DieselInternal>,
        indentation: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_pretty";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.j.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.j.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.indentation.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.indentation.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, indentation>
        QueryFragment<crate::sqlite::Sqlite> for
        json_pretty_with_indentation<J, j, indentation> where
        j: QueryFragment<crate::sqlite::Sqlite>,
        indentation: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<j, indentation>(j, indentation);
    const _: () =
        {
            use diesel;
            impl<j, indentation, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<j, indentation> where
                j: diesel::expression::ValidGrouping<__GroupByClause>,
                indentation: diesel::expression::ValidGrouping<__GroupByClause>,
                <j as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<indentation
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<j as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<indentation as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, indentation, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        json_pretty_with_indentation<J, j, indentation> where
        __Derived<j, indentation>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<j, indentation> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Returns  `true`  if the argument is well-formed JSON, or returns  `false`  if is not well-formed."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.46 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_valid};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 46, 0);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_valid::<Json, _>(json!({\"x\":35})))"]
#[doc = "     .get_result::<bool>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(true, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_valid::<Nullable<Json>, _>(None::<serde_json::Value>))"]
#[doc = "     .get_result::<Option<bool>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_valid<J: JsonOrNullableJson + MaybeNullableValue<Bool>, j>(j: j)
    -> json_valid<J, j> where j: diesel::expression::AsExpression<J> {
    json_valid_utils::json_valid {
        j: j.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_valid()`](fn@json_valid)"]
pub type json_valid<J, j> =
    json_valid_utils::json_valid<J,
    <j as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_valid_return_type {
    #[doc =
    "Return type of the [`json_valid()`](fn@super::json_valid) SQL function."]
    pub type json_valid<j> =
        super::json_valid<<j as diesel::expression::Expression>::SqlType, j>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_valid_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_valid<J, j> {
        pub(in super) j: j,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, j, __Rhs> ::core::ops::Add<__Rhs> for json_valid<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Sub<__Rhs> for json_valid<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Mul<__Rhs> for json_valid<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Div<__Rhs> for json_valid<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, j: ::core::fmt::Debug> ::core::fmt::Debug for
        json_valid<J, j> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_valid", "j", &self.j, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, j: ::core::clone::Clone>
        ::core::clone::Clone for json_valid<J, j> {
        #[inline]
        fn clone(&self) -> json_valid<J, j> {
            json_valid {
                j: ::core::clone::Clone::clone(&self.j),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, j: ::core::marker::Copy>
        ::core::marker::Copy for json_valid<J, j> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                j: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_valid<J, j> {
                type QueryId =
                    json_valid<<J as diesel::query_builder::QueryId>::QueryId,
                    <j as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <j as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        && true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <j as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_valid()`](fn@json_valid)"]
    pub type HelperType<J, j> =
        json_valid<J, <j as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJson + MaybeNullableValue<Bool>, j> Expression for
        json_valid<J, j> where (j): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJson + MaybeNullableValue<Bool>, j,
        __DieselInternal> SelectableExpression<__DieselInternal> for
        json_valid<J, j> where j: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJson + MaybeNullableValue<Bool>, j,
        __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_valid<J, j> where j: AppearsOnTable<__DieselInternal>,
        Self: Expression {}
    impl<J: JsonOrNullableJson + MaybeNullableValue<Bool>, j,
        __DieselInternal> FunctionFragment<__DieselInternal> for
        json_valid<J, j> where __DieselInternal: diesel::backend::Backend,
        j: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_valid";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.j.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.j.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJson + MaybeNullableValue<Bool>, j>
        QueryFragment<crate::sqlite::Sqlite> for json_valid<J, j> where
        j: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<j>(j);
    const _: () =
        {
            use diesel;
            impl<j, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<j> where
                j: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <j as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJson + MaybeNullableValue<Bool>, j,
        __DieselInternal> ValidGrouping<__DieselInternal> for json_valid<J, j>
        where __Derived<j>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<j> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The json_valid(X,Y) function returns 1 if the argument X is well-formed JSON, or returns 0 if X is not well-formed."]
#[doc =
" The Y parameter is an integer bitmask that defines what is meant by \"well-formed\"."]
#[doc = ""]
#[doc = " The following bits of Y are currently defined:"]
#[doc =
" - 0x01 → The input is text that strictly complies with canonical RFC-8259 JSON, without any extensions."]
#[doc = " - 0x02 → The input is text that is JSON with JSON5 extensions."]
#[doc =
" - 0x04 → The input is a BLOB that superficially appears to be JSONB."]
#[doc =
" - 0x08 → The input is a BLOB that strictly conforms to the internal JSONB format."]
#[doc = ""]
#[doc =
" By combining bits, the following useful values of Y can be derived:"]
#[doc = " - 1 → X is RFC-8259 JSON text"]
#[doc = " - 2 → X is JSON5 text"]
#[doc = " - 4 → X is probably JSONB"]
#[doc = " - 5 → X is RFC-8259 JSON text or JSONB"]
#[doc = " - 6 → X is JSON5 text or JSONB (recommended for most use cases)"]
#[doc = " - 8 → X is strictly conforming JSONB"]
#[doc = " - 9 → X is RFC-8259 or strictly conforming JSONB"]
#[doc = " - 10 → X is JSON5 or strictly conforming JSONB"]
#[doc = ""]
#[doc =
" The Y parameter must be between 1 and 15 (inclusive), or an error is raised."]
#[doc = ""]
#[doc = " If either X or Y inputs are NULL, then the function returns NULL."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.46 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_valid_with_flags};"]
#[doc = " #     use diesel::sqlite::JsonValidFlag;"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 46, 0);"]
#[doc = ""]
#[doc = " // Standard RFC-8259 JSON"]
#[doc =
" let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#\"{\"x\":35}\"#, JsonValidFlag::Rfc8259Json))"]
#[doc = "     .get_result::<bool>(connection)?;"]
#[doc = " assert_eq!(true, result);"]
#[doc = ""]
#[doc = " // JSON5 not valid as RFC-8259"]
#[doc =
" let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#\"{x:35}\"#, JsonValidFlag::Rfc8259Json))"]
#[doc = "     .get_result::<bool>(connection)?;"]
#[doc = " assert_eq!(false, result);"]
#[doc = ""]
#[doc = " // JSON5 valid with JSON5 flag"]
#[doc =
" let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#\"{x:35}\"#, JsonValidFlag::Json5OrJsonb))"]
#[doc = "     .get_result::<bool>(connection)?;"]
#[doc = " assert_eq!(true, result);"]
#[doc = ""]
#[doc = " // Invalid JSON"]
#[doc =
" let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#\"{\"x\":35\"#, JsonValidFlag::Rfc8259Json))"]
#[doc = "     .get_result::<bool>(connection)?;"]
#[doc = " assert_eq!(false, result);"]
#[doc = ""]
#[doc = " // NULL input returns NULL"]
#[doc =
" let result = diesel::select(json_valid_with_flags::<Nullable<Text>, _, _>(None::<&str>, JsonValidFlag::Rfc8259Json))"]
#[doc = "     .get_result::<Option<bool>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_valid_with_flags<X: TextOrNullableTextOrBinaryOrNullableBinary +
    SingleValue + MaybeNullableValue<Bool>, x, flags>(x: x, flags: flags)
    -> json_valid_with_flags<X, x, flags> where
    x: diesel::expression::AsExpression<X>,
    flags: diesel::expression::AsExpression<crate::sqlite::types::JsonValidFlags> {
    json_valid_with_flags_utils::json_valid_with_flags {
        x: x.as_expression(),
        flags: flags.as_expression(),
        X: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_valid_with_flags()`](fn@json_valid_with_flags)"]
pub type json_valid_with_flags<X, x, flags> =
    json_valid_with_flags_utils::json_valid_with_flags<X,
    <x as diesel::expression::AsExpression<X>>::Expression,
    <flags as
    diesel::expression::AsExpression<crate::sqlite::types::JsonValidFlags>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_valid_with_flags_return_type {
    #[doc =
    "Return type of the [`json_valid_with_flags()`](fn@super::json_valid_with_flags) SQL function."]
    pub type json_valid_with_flags<x, flags> =
        super::json_valid_with_flags<<x as
        diesel::expression::Expression>::SqlType, x, flags>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_valid_with_flags_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_valid_with_flags<X, x, flags> {
        pub(in super) x: x,
        pub(in super) flags: flags,
        pub(in super) X: ::core::marker::PhantomData<X>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<X, x, flags, __Rhs> ::core::ops::Add<__Rhs> for
                json_valid_with_flags<X, x, flags> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<X, x, flags, __Rhs> ::core::ops::Sub<__Rhs> for
                json_valid_with_flags<X, x, flags> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<X, x, flags, __Rhs> ::core::ops::Mul<__Rhs> for
                json_valid_with_flags<X, x, flags> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<X, x, flags, __Rhs> ::core::ops::Div<__Rhs> for
                json_valid_with_flags<X, x, flags> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<X: ::core::fmt::Debug, x: ::core::fmt::Debug,
        flags: ::core::fmt::Debug> ::core::fmt::Debug for
        json_valid_with_flags<X, x, flags> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_valid_with_flags", "x", &self.x, "flags", &self.flags,
                "X", &&self.X)
        }
    }
    #[automatically_derived]
    impl<X: ::core::clone::Clone, x: ::core::clone::Clone,
        flags: ::core::clone::Clone> ::core::clone::Clone for
        json_valid_with_flags<X, x, flags> {
        #[inline]
        fn clone(&self) -> json_valid_with_flags<X, x, flags> {
            json_valid_with_flags {
                x: ::core::clone::Clone::clone(&self.x),
                flags: ::core::clone::Clone::clone(&self.flags),
                X: ::core::clone::Clone::clone(&self.X),
            }
        }
    }
    #[automatically_derived]
    impl<X: ::core::marker::Copy, x: ::core::marker::Copy,
        flags: ::core::marker::Copy> ::core::marker::Copy for
        json_valid_with_flags<X, x, flags> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<X: diesel::query_builder::QueryId,
                x: diesel::query_builder::QueryId,
                flags: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_valid_with_flags<X, x, flags> {
                type QueryId =
                    json_valid_with_flags<<X as
                    diesel::query_builder::QueryId>::QueryId,
                    <x as diesel::query_builder::QueryId>::QueryId,
                    <flags as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <X as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <x as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <flags as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <X as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <x as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <flags as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`json_valid_with_flags()`](fn@json_valid_with_flags)"]
    pub type HelperType<X, x, flags> =
        json_valid_with_flags<X, <x as AsExpression<X>>::Expression,
        <flags as
        AsExpression<crate::sqlite::types::JsonValidFlags>>::Expression>;
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue +
        MaybeNullableValue<Bool>, x, flags> Expression for
        json_valid_with_flags<X, x, flags> where (x, flags): Expression {
        type SqlType = X::Out;
    }
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue +
        MaybeNullableValue<Bool>, x, flags, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_valid_with_flags<X, x, flags> where
        x: SelectableExpression<__DieselInternal>,
        flags: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue +
        MaybeNullableValue<Bool>, x, flags, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        json_valid_with_flags<X, x, flags> where
        x: AppearsOnTable<__DieselInternal>,
        flags: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue +
        MaybeNullableValue<Bool>, x, flags, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        json_valid_with_flags<X, x, flags> where
        __DieselInternal: diesel::backend::Backend,
        x: QueryFragment<__DieselInternal>,
        flags: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_valid";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.x.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.x.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.flags.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.flags.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue +
        MaybeNullableValue<Bool>, x, flags>
        QueryFragment<crate::sqlite::Sqlite> for
        json_valid_with_flags<X, x, flags> where
        x: QueryFragment<crate::sqlite::Sqlite>,
        flags: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<x, flags>(x, flags);
    const _: () =
        {
            use diesel;
            impl<x, flags, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<x, flags> where
                x: diesel::expression::ValidGrouping<__GroupByClause>,
                flags: diesel::expression::ValidGrouping<__GroupByClause>,
                <x as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<flags
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<x as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<flags as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue +
        MaybeNullableValue<Bool>, x, flags, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_valid_with_flags<X, x, flags>
        where __Derived<x, flags>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<x, flags> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The json_type(X) function returns the \"type\" of the outermost element of X."]
#[doc =
" The \"type\" returned by json_type() is one of the following SQL text values:"]
#[doc =
" \'null\', \'true\', \'false\', \'integer\', \'real\', \'text\', \'array\', or \'object\'."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_type};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type::<Json, _>(json!({\"a\": [2, 3.5, true, false, null, \"x\"]})))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(\"object\", result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type::<Jsonb, _>(json!({\"a\": [2, 3.5, true, false, null, \"x\"]})))"]
#[doc = "     .get_result::<String>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(\"object\", result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type::<Nullable<Json>, _>(None::<serde_json::Value>))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_type<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Text>, j>(j: j) -> json_type<J, j> where
    j: diesel::expression::AsExpression<J> {
    json_type_utils::json_type {
        j: j.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_type()`](fn@json_type)"]
pub type json_type<J, j> =
    json_type_utils::json_type<J,
    <j as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_type_return_type {
    #[doc =
    "Return type of the [`json_type()`](fn@super::json_type) SQL function."]
    pub type json_type<j> =
        super::json_type<<j as diesel::expression::Expression>::SqlType, j>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_type_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_type<J, j> {
        pub(in super) j: j,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, j, __Rhs> ::core::ops::Add<__Rhs> for json_type<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Sub<__Rhs> for json_type<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Mul<__Rhs> for json_type<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Div<__Rhs> for json_type<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, j: ::core::fmt::Debug> ::core::fmt::Debug for
        json_type<J, j> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f, "json_type",
                "j", &self.j, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, j: ::core::clone::Clone>
        ::core::clone::Clone for json_type<J, j> {
        #[inline]
        fn clone(&self) -> json_type<J, j> {
            json_type {
                j: ::core::clone::Clone::clone(&self.j),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, j: ::core::marker::Copy>
        ::core::marker::Copy for json_type<J, j> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                j: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_type<J, j> {
                type QueryId =
                    json_type<<J as diesel::query_builder::QueryId>::QueryId,
                    <j as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <j as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        && true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <j as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_type()`](fn@json_type)"]
    pub type HelperType<J, j> =
        json_type<J, <j as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j> Expression for json_type<J, j> where
        (j): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_type<J, j> where
        j: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_type<J, j> where
        j: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_type<J, j> where
        __DieselInternal: diesel::backend::Backend,
        j: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_type";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.j.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.j.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j> QueryFragment<crate::sqlite::Sqlite> for
        json_type<J, j> where j: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<j>(j);
    const _: () =
        {
            use diesel;
            impl<j, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<j> where
                j: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <j as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Text>, j, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_type<J, j> where
        __Derived<j>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<j> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The json_type(X,P) function returns the \"type\" of the element in X that is selected by path P."]
#[doc =
" If the path P in json_type(X,P) selects an element that does not exist in X, then this function returns NULL."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_type_with_path};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = ""]
#[doc =
" let json_value = json!({\"a\": [2, 3.5, true, false, null, \"x\"]});"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(\"array\".to_string()), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), \"$.a[0]\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(\"integer\".to_string()), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), \"$.a[1]\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(\"real\".to_string()), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), \"$.a[2]\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(\"true\".to_string()), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), \"$.a[6]\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type_with_path::<Jsonb, _, _>(json_value.clone(), \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(Some(\"array\".to_string()), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_type_with_path::<Nullable<Json>, _, _>(None::<serde_json::Value>, \"$.a\"))"]
#[doc = "     .get_result::<Option<String>>(connection)?;"]
#[doc = ""]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_type_with_path<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, j, path>(j: j, path: path) -> json_type_with_path<J, j, path>
    where j: diesel::expression::AsExpression<J>,
    path: diesel::expression::AsExpression<Text> {
    json_type_with_path_utils::json_type_with_path {
        j: j.as_expression(),
        path: path.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc =
"The return type of [`json_type_with_path()`](fn@json_type_with_path)"]
pub type json_type_with_path<J, j, path> =
    json_type_with_path_utils::json_type_with_path<J,
    <j as diesel::expression::AsExpression<J>>::Expression,
    <path as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_type_with_path_return_type {
    #[doc =
    "Return type of the [`json_type_with_path()`](fn@super::json_type_with_path) SQL function."]
    pub type json_type_with_path<j, path> =
        super::json_type_with_path<<j as
        diesel::expression::Expression>::SqlType, j, path>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_type_with_path_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_type_with_path<J, j, path> {
        pub(in super) j: j,
        pub(in super) path: path,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, j, path, __Rhs> ::core::ops::Add<__Rhs> for
                json_type_with_path<J, j, path> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, j, path, __Rhs> ::core::ops::Sub<__Rhs> for
                json_type_with_path<J, j, path> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, j, path, __Rhs> ::core::ops::Mul<__Rhs> for
                json_type_with_path<J, j, path> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, j, path, __Rhs> ::core::ops::Div<__Rhs> for
                json_type_with_path<J, j, path> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, j: ::core::fmt::Debug,
        path: ::core::fmt::Debug> ::core::fmt::Debug for
        json_type_with_path<J, j, path> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_type_with_path", "j", &self.j, "path", &self.path, "J",
                &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, j: ::core::clone::Clone,
        path: ::core::clone::Clone> ::core::clone::Clone for
        json_type_with_path<J, j, path> {
        #[inline]
        fn clone(&self) -> json_type_with_path<J, j, path> {
            json_type_with_path {
                j: ::core::clone::Clone::clone(&self.j),
                path: ::core::clone::Clone::clone(&self.path),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, j: ::core::marker::Copy,
        path: ::core::marker::Copy> ::core::marker::Copy for
        json_type_with_path<J, j, path> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                j: diesel::query_builder::QueryId,
                path: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_type_with_path<J, j, path> {
                type QueryId =
                    json_type_with_path<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <j as diesel::query_builder::QueryId>::QueryId,
                    <path as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <j as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <path as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <j as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <path as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc =
    "The return type of [`json_type_with_path()`](fn@json_type_with_path)"]
    pub type HelperType<J, j, path> =
        json_type_with_path<J, <j as AsExpression<J>>::Expression,
        <path as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path>
        Expression for json_type_with_path<J, j, path> where
        (j, path): Expression {
        type SqlType = Nullable<Text>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path,
        __DieselInternal> SelectableExpression<__DieselInternal> for
        json_type_with_path<J, j, path> where
        j: SelectableExpression<__DieselInternal>,
        path: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path,
        __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_type_with_path<J, j, path> where
        j: AppearsOnTable<__DieselInternal>,
        path: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path,
        __DieselInternal> FunctionFragment<__DieselInternal> for
        json_type_with_path<J, j, path> where
        __DieselInternal: diesel::backend::Backend,
        j: QueryFragment<__DieselInternal>,
        path: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_type";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.j.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.j.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path>
        QueryFragment<crate::sqlite::Sqlite> for
        json_type_with_path<J, j, path> where
        j: QueryFragment<crate::sqlite::Sqlite>,
        path: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<j, path>(j, path);
    const _: () =
        {
            use diesel;
            impl<j, path, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<j, path> where
                j: diesel::expression::ValidGrouping<__GroupByClause>,
                path: diesel::expression::ValidGrouping<__GroupByClause>,
                <j as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<j as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, j, path,
        __DieselInternal> ValidGrouping<__DieselInternal> for
        json_type_with_path<J, j, path> where
        __Derived<j, path>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<j, path> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The json_quote(X) function converts the SQL value X (a number or a string) into its corresponding JSON"]
#[doc =
" representation. If X is a JSON value returned by another JSON function, then this function is a no-op."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::{sql, json_quote};"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc =
" #     use diesel::sql_types::{Text, Json, Integer, Float, Double, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_quote::<Integer, _>(42))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!(42), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_quote::<Text, _>(\"verdant\"))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!(\"verdant\"), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_quote::<Text, _>(\"[1]\"))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!(\"[1]\"), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_quote::<Nullable<Text>, _>(None::<&str>))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!(null), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_quote::<Double, _>(3.14159))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!(3.14159), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_quote::<Json, _>(json!([1])))"]
#[doc = "     .get_result::<Value>(connection)?;"]
#[doc = ""]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_quote<J: SqlType + SingleValue, j>(j: j) -> json_quote<J, j> where
    j: diesel::expression::AsExpression<J> {
    json_quote_utils::json_quote {
        j: j.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_quote()`](fn@json_quote)"]
pub type json_quote<J, j> =
    json_quote_utils::json_quote<J,
    <j as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_quote_return_type {
    #[doc =
    "Return type of the [`json_quote()`](fn@super::json_quote) SQL function."]
    pub type json_quote<j> =
        super::json_quote<<j as diesel::expression::Expression>::SqlType, j>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_quote_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_quote<J, j> {
        pub(in super) j: j,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, j, __Rhs> ::core::ops::Add<__Rhs> for json_quote<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Sub<__Rhs> for json_quote<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Mul<__Rhs> for json_quote<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, j, __Rhs> ::core::ops::Div<__Rhs> for json_quote<J, j>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, j: ::core::fmt::Debug> ::core::fmt::Debug for
        json_quote<J, j> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_quote", "j", &self.j, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, j: ::core::clone::Clone>
        ::core::clone::Clone for json_quote<J, j> {
        #[inline]
        fn clone(&self) -> json_quote<J, j> {
            json_quote {
                j: ::core::clone::Clone::clone(&self.j),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, j: ::core::marker::Copy>
        ::core::marker::Copy for json_quote<J, j> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                j: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_quote<J, j> {
                type QueryId =
                    json_quote<<J as diesel::query_builder::QueryId>::QueryId,
                    <j as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <j as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        && true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <j as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_quote()`](fn@json_quote)"]
    pub type HelperType<J, j> =
        json_quote<J, <j as AsExpression<J>>::Expression>;
    impl<J: SqlType + SingleValue, j> Expression for json_quote<J, j> where
        (j): Expression {
        type SqlType = Json;
    }
    impl<J: SqlType + SingleValue, j, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_quote<J, j> where
        j: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: SqlType + SingleValue, j, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_quote<J, j> where
        j: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: SqlType + SingleValue, j, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_quote<J, j> where
        __DieselInternal: diesel::backend::Backend,
        j: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_quote";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.j.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.j.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: SqlType + SingleValue, j> QueryFragment<crate::sqlite::Sqlite> for
        json_quote<J, j> where j: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<j>(j);
    const _: () =
        {
            use diesel;
            impl<j, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<j> where
                j: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <j as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: SqlType + SingleValue, j, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_quote<J, j> where
        __Derived<j>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<j> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_group_array(X)` function is an aggregate SQL function that returns a JSON array comprised of"]
#[doc = " all X values in the aggregation."]
#[doc = ""]
#[doc = " ## Aggregate Function Expression"]
#[doc = ""]
#[doc =
" This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details."]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ## Normal function usage"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #"]
#[doc = " let result = animals"]
#[doc = "     .select(json_group_array(species))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([\"dog\", \"spider\"]));"]
#[doc = ""]
#[doc = " let result = animals"]
#[doc = "     .select(json_group_array(legs))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([4, 8]));"]
#[doc = ""]
#[doc = " let result = animals"]
#[doc = "     .select(json_group_array(name))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([\"Jack\", null]));"]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[doc = " ## Aggregate function expression"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #"]
#[doc = " let result = animals"]
#[doc =
"     .select(json_group_array(species).aggregate_filter(legs.lt(8)))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([\"dog\"]));"]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[doc = ""]
#[doc = " # See also"]
#[doc =
" - [`jsonb_group_array`](jsonb_group_array()) will return data in JSONB format instead of JSON."]
#[doc =
" - [`json_group_object`](json_group_object()) will return JSON object instead of array."]
#[allow(non_camel_case_types)]
pub fn json_group_array<E: SqlType + SingleValue,
    elements>(elements: elements) -> json_group_array<E, elements> where
    elements: diesel::expression::AsExpression<E> {
    json_group_array_utils::json_group_array {
        elements: elements.as_expression(),
        E: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_group_array()`](fn@json_group_array)"]
pub type json_group_array<E, elements> =
    json_group_array_utils::json_group_array<E,
    <elements as diesel::expression::AsExpression<E>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_group_array_return_type {
    #[doc =
    "Return type of the [`json_group_array()`](fn@super::json_group_array) SQL function."]
    pub type json_group_array<elements> =
        super::json_group_array<<elements as
        diesel::expression::Expression>::SqlType, elements>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_group_array_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_group_array<E, elements> {
        pub(in super) elements: elements,
        pub(in super) E: ::core::marker::PhantomData<E>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<E, elements, __Rhs> ::core::ops::Add<__Rhs> for
                json_group_array<E, elements> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<E, elements, __Rhs> ::core::ops::Sub<__Rhs> for
                json_group_array<E, elements> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<E, elements, __Rhs> ::core::ops::Mul<__Rhs> for
                json_group_array<E, elements> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<E, elements, __Rhs> ::core::ops::Div<__Rhs> for
                json_group_array<E, elements> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<E: ::core::fmt::Debug, elements: ::core::fmt::Debug>
        ::core::fmt::Debug for json_group_array<E, elements> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_group_array", "elements", &self.elements, "E", &&self.E)
        }
    }
    #[automatically_derived]
    impl<E: ::core::clone::Clone, elements: ::core::clone::Clone>
        ::core::clone::Clone for json_group_array<E, elements> {
        #[inline]
        fn clone(&self) -> json_group_array<E, elements> {
            json_group_array {
                elements: ::core::clone::Clone::clone(&self.elements),
                E: ::core::clone::Clone::clone(&self.E),
            }
        }
    }
    #[automatically_derived]
    impl<E: ::core::marker::Copy, elements: ::core::marker::Copy>
        ::core::marker::Copy for json_group_array<E, elements> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<E: diesel::query_builder::QueryId,
                elements: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_group_array<E, elements> {
                type QueryId =
                    json_group_array<<E as
                    diesel::query_builder::QueryId>::QueryId,
                    <elements as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <E as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <elements as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <E as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <elements as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_group_array()`](fn@json_group_array)"]
    pub type HelperType<E, elements> =
        json_group_array<E, <elements as AsExpression<E>>::Expression>;
    impl<E: SqlType + SingleValue, elements> Expression for
        json_group_array<E, elements> where (elements): Expression {
        type SqlType = Json;
    }
    impl<E: SqlType + SingleValue, elements, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_group_array<E, elements> where
        elements: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<E: SqlType + SingleValue, elements, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_group_array<E, elements>
        where elements: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<E: SqlType + SingleValue, elements, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_group_array<E, elements>
        where __DieselInternal: diesel::backend::Backend,
        elements: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_group_array";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.elements.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.elements.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<E: SqlType + SingleValue, elements>
        QueryFragment<crate::sqlite::Sqlite> for json_group_array<E, elements>
        where elements: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    impl<E: SqlType + SingleValue, elements, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_group_array<E, elements> {
        type IsAggregate = diesel::expression::is_aggregate::Yes;
    }
    impl<E: SqlType + SingleValue, elements> IsAggregateFunction for
        json_group_array<E, elements> {}
}
#[doc =
" The `jsonb_group_array(X)` function is an aggregate SQL function that returns a JSONB array comprised of"]
#[doc = " all X values in the aggregation."]
#[doc = ""]
#[doc = " ## Aggregate Function Expression"]
#[doc = ""]
#[doc =
" This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details."]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ## Normal function usage"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #"]
#[doc = " let result = animals"]
#[doc = "     .select(json_group_array(species))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([\"dog\", \"spider\"]));"]
#[doc = ""]
#[doc = " let result = animals"]
#[doc = "     .select(json_group_array(legs))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([4, 8]));"]
#[doc = ""]
#[doc = " let result = animals"]
#[doc = "     .select(json_group_array(name))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([\"Jack\", null]));"]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[doc = ""]
#[doc = " ## Aggregate function expression"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #"]
#[doc = " let result = animals"]
#[doc =
"     .select(json_group_array(species).aggregate_filter(legs.lt(8)))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([\"dog\"]));"]
#[doc = ""]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[doc = ""]
#[doc = " # See also"]
#[doc =
" - [`json_group_array`](json_group_array()) will return data in JSON format instead of JSONB."]
#[doc =
" - [`jsonb_group_object`](jsonb_group_object()) will return JSONB object instead of array."]
#[allow(non_camel_case_types)]
pub fn jsonb_group_array<E: SqlType + SingleValue,
    elements>(elements: elements) -> jsonb_group_array<E, elements> where
    elements: diesel::expression::AsExpression<E> {
    jsonb_group_array_utils::jsonb_group_array {
        elements: elements.as_expression(),
        E: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_group_array()`](fn@jsonb_group_array)"]
pub type jsonb_group_array<E, elements> =
    jsonb_group_array_utils::jsonb_group_array<E,
    <elements as diesel::expression::AsExpression<E>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_group_array_return_type {
    #[doc =
    "Return type of the [`jsonb_group_array()`](fn@super::jsonb_group_array) SQL function."]
    pub type jsonb_group_array<elements> =
        super::jsonb_group_array<<elements as
        diesel::expression::Expression>::SqlType, elements>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_group_array_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_group_array<E, elements> {
        pub(in super) elements: elements,
        pub(in super) E: ::core::marker::PhantomData<E>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<E, elements, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_group_array<E, elements> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<E, elements, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_group_array<E, elements> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<E, elements, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_group_array<E, elements> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<E, elements, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_group_array<E, elements> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<E: ::core::fmt::Debug, elements: ::core::fmt::Debug>
        ::core::fmt::Debug for jsonb_group_array<E, elements> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "jsonb_group_array", "elements", &self.elements, "E",
                &&self.E)
        }
    }
    #[automatically_derived]
    impl<E: ::core::clone::Clone, elements: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_group_array<E, elements> {
        #[inline]
        fn clone(&self) -> jsonb_group_array<E, elements> {
            jsonb_group_array {
                elements: ::core::clone::Clone::clone(&self.elements),
                E: ::core::clone::Clone::clone(&self.E),
            }
        }
    }
    #[automatically_derived]
    impl<E: ::core::marker::Copy, elements: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_group_array<E, elements> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<E: diesel::query_builder::QueryId,
                elements: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_group_array<E, elements> {
                type QueryId =
                    jsonb_group_array<<E as
                    diesel::query_builder::QueryId>::QueryId,
                    <elements as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <E as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <elements as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <E as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <elements as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`jsonb_group_array()`](fn@jsonb_group_array)"]
    pub type HelperType<E, elements> =
        jsonb_group_array<E, <elements as AsExpression<E>>::Expression>;
    impl<E: SqlType + SingleValue, elements> Expression for
        jsonb_group_array<E, elements> where (elements): Expression {
        type SqlType = Jsonb;
    }
    impl<E: SqlType + SingleValue, elements, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_group_array<E, elements> where
        elements: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<E: SqlType + SingleValue, elements, __DieselInternal>
        AppearsOnTable<__DieselInternal> for jsonb_group_array<E, elements>
        where elements: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<E: SqlType + SingleValue, elements, __DieselInternal>
        FunctionFragment<__DieselInternal> for jsonb_group_array<E, elements>
        where __DieselInternal: diesel::backend::Backend,
        elements: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_group_array";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.elements.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.elements.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<E: SqlType + SingleValue, elements>
        QueryFragment<crate::sqlite::Sqlite> for
        jsonb_group_array<E, elements> where
        elements: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    impl<E: SqlType + SingleValue, elements, __DieselInternal>
        ValidGrouping<__DieselInternal> for jsonb_group_array<E, elements> {
        type IsAggregate = diesel::expression::is_aggregate::Yes;
    }
    impl<E: SqlType + SingleValue, elements> IsAggregateFunction for
        jsonb_group_array<E, elements> {}
}
#[doc =
" The `json_object()` SQL function accepts zero or more pairs of arguments and returns a"]
#[doc =
" well-formed JSON object composed from those pairs. The first argument of each pair is the"]
#[doc =
" label (key) and the second argument is the value. If any argument to `json_object()` is a"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_object_0`, `json_object_1`, ... `json_object_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_object")]
#[doc = " BLOB then an error is thrown."]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string even if the"]
#[doc =
" input text is well-formed JSON. However, if the argument is the direct result from another"]
#[doc =
" JSON function, then it is treated as JSON and all of its JSON type information and"]
#[doc =
" substructure is preserved. This allows calls to `json_object()` and `json_array()` to be"]
#[doc =
" nested. The [`json()`] function can also be used to force strings to be recognized as JSON."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Integer};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(json_object_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_object_1::<Text, Integer, _, _>(\"a\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     json_object_2::<Text, Integer, Text, Text, _, _, _, _>(\"a\", 2, \"c\", \"{e:5}\")"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": \"{e:5}\"}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     json_object_2::<Text, Integer, Text, Json, _, _, _, _>(\"a\", 2, \"c\", json_object_1::<Text, Integer, _, _>(\"e\", 5))"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": {\"e\": 5}}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_object_0() -> json_object_0 where  {
    json_object_0_utils::json_object_0 {}
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_object_0()`](fn@json_object_0)"]
pub type json_object_0 = json_object_0_utils::json_object_0<>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_object_0_return_type {
    #[doc =
    "Return type of the [`json_object_0()`](fn@super::json_object_0) SQL function."]
    pub type json_object_0 = super::json_object_0<>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_object_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_object_0 {}
    #[automatically_derived]
    impl ::core::fmt::Debug for json_object_0 {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::write_str(f, "json_object_0")
        }
    }
    #[automatically_derived]
    #[doc(hidden)]
    unsafe impl ::core::clone::TrivialClone for json_object_0 { }
    #[automatically_derived]
    impl ::core::clone::Clone for json_object_0 {
        #[inline]
        fn clone(&self) -> json_object_0 { *self }
    }
    #[automatically_derived]
    impl ::core::marker::Copy for json_object_0 { }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl diesel::query_builder::QueryId for json_object_0 {
                type QueryId = json_object_0<>;
                const HAS_STATIC_QUERY_ID: bool = true;
                const IS_WINDOW_FUNCTION: bool = false;
            }
        };
    #[doc = "The return type of [`json_object_0()`](fn@json_object_0)"]
    pub type HelperType = json_object_0<>;
    impl Expression for json_object_0 where  {
        type SqlType = Json;
    }
    impl<__DieselInternal> SelectableExpression<__DieselInternal> for
        json_object_0 where Self: AppearsOnTable<__DieselInternal> {}
    impl<__DieselInternal> AppearsOnTable<__DieselInternal> for json_object_0
        where Self: Expression {}
    impl<__DieselInternal> FunctionFragment<__DieselInternal> for
        json_object_0 where __DieselInternal: diesel::backend::Backend {
        const FUNCTION_NAME: &'static str = "json_object";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            Ok(())
        }
    }
    impl QueryFragment<crate::sqlite::Sqlite> for json_object_0 where  {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived();
    const _: () =
        {
            use diesel;
            impl<__GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived {
                type IsAggregate = diesel::expression::is_aggregate::Never;
            }
        };
    impl<__DieselInternal> ValidGrouping<__DieselInternal> for json_object_0
        where __Derived<>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_object()` SQL function accepts zero or more pairs of arguments and returns a"]
#[doc =
" well-formed JSON object composed from those pairs. The first argument of each pair is the"]
#[doc =
" label (key) and the second argument is the value. If any argument to `json_object()` is a"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_object_0`, `json_object_1`, ... `json_object_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_object")]
#[doc = " BLOB then an error is thrown."]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string even if the"]
#[doc =
" input text is well-formed JSON. However, if the argument is the direct result from another"]
#[doc =
" JSON function, then it is treated as JSON and all of its JSON type information and"]
#[doc =
" substructure is preserved. This allows calls to `json_object()` and `json_array()` to be"]
#[doc =
" nested. The [`json()`] function can also be used to force strings to be recognized as JSON."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Integer};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(json_object_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_object_1::<Text, Integer, _, _>(\"a\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     json_object_2::<Text, Integer, Text, Text, _, _, _, _>(\"a\", 2, \"c\", \"{e:5}\")"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": \"{e:5}\"}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     json_object_2::<Text, Integer, Text, Json, _, _, _, _>(\"a\", 2, \"c\", json_object_1::<Text, Integer, _, _>(\"e\", 5))"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": {\"e\": 5}}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_object_1<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
    key_1, value_1>(key_1: key_1, value_1: value_1)
    -> json_object_1<K1, V1, key_1, value_1> where
    key_1: diesel::expression::AsExpression<K1>,
    value_1: diesel::expression::AsExpression<V1> {
    json_object_1_utils::json_object_1 {
        key_1: key_1.as_expression(),
        value_1: value_1.as_expression(),
        K1: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_object_1()`](fn@json_object_1)"]
pub type json_object_1<K1, V1, key_1, value_1> =
    json_object_1_utils::json_object_1<K1, V1,
    <key_1 as diesel::expression::AsExpression<K1>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_object_1_return_type {
    #[doc =
    "Return type of the [`json_object_1()`](fn@super::json_object_1) SQL function."]
    pub type json_object_1<key_1, value_1> =
        super::json_object_1<<key_1 as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType, key_1, value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_object_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_object_1<K1, V1, key_1, value_1> {
        pub(in super) key_1: key_1,
        pub(in super) value_1: value_1,
        pub(in super) K1: ::core::marker::PhantomData<K1>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<K1, V1, key_1, value_1, __Rhs> ::core::ops::Add<__Rhs> for
                json_object_1<K1, V1, key_1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, key_1, value_1, __Rhs> ::core::ops::Sub<__Rhs> for
                json_object_1<K1, V1, key_1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, key_1, value_1, __Rhs> ::core::ops::Mul<__Rhs> for
                json_object_1<K1, V1, key_1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, key_1, value_1, __Rhs> ::core::ops::Div<__Rhs> for
                json_object_1<K1, V1, key_1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<K1: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        key_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug>
        ::core::fmt::Debug for json_object_1<K1, V1, key_1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "json_object_1", "key_1", &self.key_1, "value_1",
                &self.value_1, "K1", &self.K1, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<K1: ::core::clone::Clone, V1: ::core::clone::Clone,
        key_1: ::core::clone::Clone, value_1: ::core::clone::Clone>
        ::core::clone::Clone for json_object_1<K1, V1, key_1, value_1> {
        #[inline]
        fn clone(&self) -> json_object_1<K1, V1, key_1, value_1> {
            json_object_1 {
                key_1: ::core::clone::Clone::clone(&self.key_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                K1: ::core::clone::Clone::clone(&self.K1),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<K1: ::core::marker::Copy, V1: ::core::marker::Copy,
        key_1: ::core::marker::Copy, value_1: ::core::marker::Copy>
        ::core::marker::Copy for json_object_1<K1, V1, key_1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<K1: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                key_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_object_1<K1, V1, key_1, value_1> {
                type QueryId =
                    json_object_1<<K1 as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <key_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <K1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <key_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <K1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <key_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_object_1()`](fn@json_object_1)"]
    pub type HelperType<K1, V1, key_1, value_1> =
        json_object_1<K1, V1, <key_1 as AsExpression<K1>>::Expression,
        <value_1 as AsExpression<V1>>::Expression>;
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1> Expression for json_object_1<K1, V1, key_1, value_1> where
        (key_1, value_1): Expression {
        type SqlType = Json;
    }
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_object_1<K1, V1, key_1, value_1> where
        key_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_object_1<K1, V1, key_1, value_1> where
        key_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_object_1<K1, V1, key_1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        key_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_object";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.key_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.key_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1> QueryFragment<crate::sqlite::Sqlite> for
        json_object_1<K1, V1, key_1, value_1> where
        key_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<key_1, value_1>(key_1, value_1);
    const _: () =
        {
            use diesel;
            impl<key_1, value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<key_1, value_1> where
                key_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <key_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<key_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_object_1<K1, V1, key_1, value_1> where
        __Derived<key_1, value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<key_1, value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_object()` SQL function accepts zero or more pairs of arguments and returns a"]
#[doc =
" well-formed JSON object composed from those pairs. The first argument of each pair is the"]
#[doc =
" label (key) and the second argument is the value. If any argument to `json_object()` is a"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_object_0`, `json_object_1`, ... `json_object_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_object")]
#[doc = " BLOB then an error is thrown."]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string even if the"]
#[doc =
" input text is well-formed JSON. However, if the argument is the direct result from another"]
#[doc =
" JSON function, then it is treated as JSON and all of its JSON type information and"]
#[doc =
" substructure is preserved. This allows calls to `json_object()` and `json_array()` to be"]
#[doc =
" nested. The [`json()`] function can also be used to force strings to be recognized as JSON."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Integer};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(json_object_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_object_1::<Text, Integer, _, _>(\"a\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     json_object_2::<Text, Integer, Text, Text, _, _, _, _>(\"a\", 2, \"c\", \"{e:5}\")"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": \"{e:5}\"}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     json_object_2::<Text, Integer, Text, Json, _, _, _, _>(\"a\", 2, \"c\", json_object_1::<Text, Integer, _, _>(\"e\", 5))"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": {\"e\": 5}}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_object_2<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
    K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1, value_1,
    key_2,
    value_2>(key_1: key_1, value_1: value_1, key_2: key_2, value_2: value_2)
    -> json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
    key_1: diesel::expression::AsExpression<K1>,
    value_1: diesel::expression::AsExpression<V1>,
    key_2: diesel::expression::AsExpression<K2>,
    value_2: diesel::expression::AsExpression<V2> {
    json_object_2_utils::json_object_2 {
        key_1: key_1.as_expression(),
        value_1: value_1.as_expression(),
        key_2: key_2.as_expression(),
        value_2: value_2.as_expression(),
        K1: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
        K2: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_object_2()`](fn@json_object_2)"]
pub type json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> =
    json_object_2_utils::json_object_2<K1, V1, K2, V2,
    <key_1 as diesel::expression::AsExpression<K1>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <key_2 as diesel::expression::AsExpression<K2>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_object_2_return_type {
    #[doc =
    "Return type of the [`json_object_2()`](fn@super::json_object_2) SQL function."]
    pub type json_object_2<key_1, value_1, key_2, value_2> =
        super::json_object_2<<key_1 as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType,
        <key_2 as diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, key_1, value_1,
        key_2, value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_object_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> {
        pub(in super) key_1: key_1,
        pub(in super) value_1: value_1,
        pub(in super) key_2: key_2,
        pub(in super) value_2: value_2,
        pub(in super) K1: ::core::marker::PhantomData<K1>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) K2: ::core::marker::PhantomData<K2>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<K1, V1, K2, V2, key_1, value_1, key_2, value_2, __Rhs>
                ::core::ops::Add<__Rhs> for
                json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, K2, V2, key_1, value_1, key_2, value_2, __Rhs>
                ::core::ops::Sub<__Rhs> for
                json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, K2, V2, key_1, value_1, key_2, value_2, __Rhs>
                ::core::ops::Mul<__Rhs> for
                json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, K2, V2, key_1, value_1, key_2, value_2, __Rhs>
                ::core::ops::Div<__Rhs> for
                json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<K1: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        K2: ::core::fmt::Debug, V2: ::core::fmt::Debug,
        key_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug,
        key_2: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            let names: &'static _ =
                &["key_1", "value_1", "key_2", "value_2", "K1", "V1", "K2",
                            "V2"];
            let values: &[&dyn ::core::fmt::Debug] =
                &[&self.key_1, &self.value_1, &self.key_2, &self.value_2,
                            &self.K1, &self.V1, &self.K2, &&self.V2];
            ::core::fmt::Formatter::debug_struct_fields_finish(f,
                "json_object_2", names, values)
        }
    }
    #[automatically_derived]
    impl<K1: ::core::clone::Clone, V1: ::core::clone::Clone,
        K2: ::core::clone::Clone, V2: ::core::clone::Clone,
        key_1: ::core::clone::Clone, value_1: ::core::clone::Clone,
        key_2: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> {
        #[inline]
        fn clone(&self)
            -> json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> {
            json_object_2 {
                key_1: ::core::clone::Clone::clone(&self.key_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                key_2: ::core::clone::Clone::clone(&self.key_2),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                K1: ::core::clone::Clone::clone(&self.K1),
                V1: ::core::clone::Clone::clone(&self.V1),
                K2: ::core::clone::Clone::clone(&self.K2),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<K1: ::core::marker::Copy, V1: ::core::marker::Copy,
        K2: ::core::marker::Copy, V2: ::core::marker::Copy,
        key_1: ::core::marker::Copy, value_1: ::core::marker::Copy,
        key_2: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<K1: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                K2: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                key_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                key_2: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                {
                type QueryId =
                    json_object_2<<K1 as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <K2 as diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <key_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <key_2 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <K1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                    &&
                                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                &&
                                                <K2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                            &&
                                            <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                        &&
                                        <key_1 as
                                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                    <value_1 as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <key_2 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <K1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                    ||
                                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                ||
                                                <K2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                            ||
                                            <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                        ||
                                        <key_1 as
                                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <value_1 as
                                        diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <key_2 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_object_2()`](fn@json_object_2)"]
    pub type HelperType<K1, V1, K2, V2, key_1, value_1, key_2, value_2> =
        json_object_2<K1, V1, K2, V2, <key_1 as AsExpression<K1>>::Expression,
        <value_1 as AsExpression<V1>>::Expression,
        <key_2 as AsExpression<K2>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2> Expression for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        (key_1, value_1, key_2, value_2): Expression {
        type SqlType = Json;
    }
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        key_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        key_2: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        key_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>,
        key_2: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        __DieselInternal: diesel::backend::Backend,
        key_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal>,
        key_2: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_object";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.key_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.key_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.key_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.key_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2> QueryFragment<crate::sqlite::Sqlite> for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        key_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        key_2: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<key_1, value_1, key_2,
        value_2>(key_1, value_1, key_2, value_2);
    const _: () =
        {
            use diesel;
            impl<key_1, value_1, key_2, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<key_1, value_1, key_2, value_2> where
                key_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                key_2: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <key_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<key_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<key_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<key_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<key_2 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<<key_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<key_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        json_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        __Derived<key_1, value_1, key_2,
        value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<key_1, value_1, key_2, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __json_object_return_types {
    #[doc(inline)]
    pub use super::__json_object_0_return_type::*;
    #[doc(inline)]
    pub use super::__json_object_1_return_type::*;
    #[doc(inline)]
    pub use super::__json_object_2_return_type::*;
}
#[doc =
" The `jsonb_object()` SQL function works just like the [`json_object()`](json_object_1())"]
#[doc =
" function except that the generated object is returned in SQLite\'s private binary JSONB"]
#[doc = " format rather than in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_object_0`, `jsonb_object_1`, ... `jsonb_object_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_object")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Integer};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(jsonb_object_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_object_1::<Text, Integer, _, _>(\"a\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     jsonb_object_2::<Text, Integer, Text, Text, _, _, _, _>(\"a\", 2, \"c\", \"{e:5}\")"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": \"{e:5}\"}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_object_0() -> jsonb_object_0 where  {
    jsonb_object_0_utils::jsonb_object_0 {}
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_object_0()`](fn@jsonb_object_0)"]
pub type jsonb_object_0 = jsonb_object_0_utils::jsonb_object_0<>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_object_0_return_type {
    #[doc =
    "Return type of the [`jsonb_object_0()`](fn@super::jsonb_object_0) SQL function."]
    pub type jsonb_object_0 = super::jsonb_object_0<>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_object_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_object_0 {}
    #[automatically_derived]
    impl ::core::fmt::Debug for jsonb_object_0 {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::write_str(f, "jsonb_object_0")
        }
    }
    #[automatically_derived]
    #[doc(hidden)]
    unsafe impl ::core::clone::TrivialClone for jsonb_object_0 { }
    #[automatically_derived]
    impl ::core::clone::Clone for jsonb_object_0 {
        #[inline]
        fn clone(&self) -> jsonb_object_0 { *self }
    }
    #[automatically_derived]
    impl ::core::marker::Copy for jsonb_object_0 { }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl diesel::query_builder::QueryId for jsonb_object_0 {
                type QueryId = jsonb_object_0<>;
                const HAS_STATIC_QUERY_ID: bool = true;
                const IS_WINDOW_FUNCTION: bool = false;
            }
        };
    #[doc = "The return type of [`jsonb_object_0()`](fn@jsonb_object_0)"]
    pub type HelperType = jsonb_object_0<>;
    impl Expression for jsonb_object_0 where  {
        type SqlType = Jsonb;
    }
    impl<__DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_object_0 where Self: AppearsOnTable<__DieselInternal> {}
    impl<__DieselInternal> AppearsOnTable<__DieselInternal> for jsonb_object_0
        where Self: Expression {}
    impl<__DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_object_0 where __DieselInternal: diesel::backend::Backend {
        const FUNCTION_NAME: &'static str = "jsonb_object";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            Ok(())
        }
    }
    impl QueryFragment<crate::sqlite::Sqlite> for jsonb_object_0 where  {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived();
    const _: () =
        {
            use diesel;
            impl<__GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived {
                type IsAggregate = diesel::expression::is_aggregate::Never;
            }
        };
    impl<__DieselInternal> ValidGrouping<__DieselInternal> for jsonb_object_0
        where __Derived<>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_object()` SQL function works just like the [`json_object()`](json_object_1())"]
#[doc =
" function except that the generated object is returned in SQLite\'s private binary JSONB"]
#[doc = " format rather than in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_object_0`, `jsonb_object_1`, ... `jsonb_object_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_object")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Integer};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(jsonb_object_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_object_1::<Text, Integer, _, _>(\"a\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     jsonb_object_2::<Text, Integer, Text, Text, _, _, _, _>(\"a\", 2, \"c\", \"{e:5}\")"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": \"{e:5}\"}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_object_1<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
    key_1, value_1>(key_1: key_1, value_1: value_1)
    -> jsonb_object_1<K1, V1, key_1, value_1> where
    key_1: diesel::expression::AsExpression<K1>,
    value_1: diesel::expression::AsExpression<V1> {
    jsonb_object_1_utils::jsonb_object_1 {
        key_1: key_1.as_expression(),
        value_1: value_1.as_expression(),
        K1: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_object_1()`](fn@jsonb_object_1)"]
pub type jsonb_object_1<K1, V1, key_1, value_1> =
    jsonb_object_1_utils::jsonb_object_1<K1, V1,
    <key_1 as diesel::expression::AsExpression<K1>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_object_1_return_type {
    #[doc =
    "Return type of the [`jsonb_object_1()`](fn@super::jsonb_object_1) SQL function."]
    pub type jsonb_object_1<key_1, value_1> =
        super::jsonb_object_1<<key_1 as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType, key_1, value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_object_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_object_1<K1, V1, key_1, value_1> {
        pub(in super) key_1: key_1,
        pub(in super) value_1: value_1,
        pub(in super) K1: ::core::marker::PhantomData<K1>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<K1, V1, key_1, value_1, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_object_1<K1, V1, key_1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, key_1, value_1, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_object_1<K1, V1, key_1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, key_1, value_1, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_object_1<K1, V1, key_1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, key_1, value_1, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_object_1<K1, V1, key_1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<K1: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        key_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug>
        ::core::fmt::Debug for jsonb_object_1<K1, V1, key_1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "jsonb_object_1", "key_1", &self.key_1, "value_1",
                &self.value_1, "K1", &self.K1, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<K1: ::core::clone::Clone, V1: ::core::clone::Clone,
        key_1: ::core::clone::Clone, value_1: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_object_1<K1, V1, key_1, value_1> {
        #[inline]
        fn clone(&self) -> jsonb_object_1<K1, V1, key_1, value_1> {
            jsonb_object_1 {
                key_1: ::core::clone::Clone::clone(&self.key_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                K1: ::core::clone::Clone::clone(&self.K1),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<K1: ::core::marker::Copy, V1: ::core::marker::Copy,
        key_1: ::core::marker::Copy, value_1: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_object_1<K1, V1, key_1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<K1: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                key_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_object_1<K1, V1, key_1, value_1> {
                type QueryId =
                    jsonb_object_1<<K1 as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <key_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <K1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <key_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <K1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <key_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_object_1()`](fn@jsonb_object_1)"]
    pub type HelperType<K1, V1, key_1, value_1> =
        jsonb_object_1<K1, V1, <key_1 as AsExpression<K1>>::Expression,
        <value_1 as AsExpression<V1>>::Expression>;
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1> Expression for jsonb_object_1<K1, V1, key_1, value_1> where
        (key_1, value_1): Expression {
        type SqlType = Jsonb;
    }
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_object_1<K1, V1, key_1, value_1> where
        key_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_object_1<K1, V1, key_1, value_1> where
        key_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_object_1<K1, V1, key_1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        key_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_object";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.key_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.key_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_object_1<K1, V1, key_1, value_1> where
        key_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<key_1, value_1>(key_1, value_1);
    const _: () =
        {
            use diesel;
            impl<key_1, value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<key_1, value_1> where
                key_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <key_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<key_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob, key_1,
        value_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_object_1<K1, V1, key_1, value_1> where
        __Derived<key_1, value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<key_1, value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_object()` SQL function works just like the [`json_object()`](json_object_1())"]
#[doc =
" function except that the generated object is returned in SQLite\'s private binary JSONB"]
#[doc = " format rather than in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_object_0`, `jsonb_object_1`, ... `jsonb_object_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_object")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Integer};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(jsonb_object_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_object_1::<Text, Integer, _, _>(\"a\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select("]
#[doc =
"     jsonb_object_2::<Text, Integer, Text, Text, _, _, _, _>(\"a\", 2, \"c\", \"{e:5}\")"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 2, \"c\": \"{e:5}\"}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_object_2<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
    K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1, value_1,
    key_2,
    value_2>(key_1: key_1, value_1: value_1, key_2: key_2, value_2: value_2)
    -> jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
    key_1: diesel::expression::AsExpression<K1>,
    value_1: diesel::expression::AsExpression<V1>,
    key_2: diesel::expression::AsExpression<K2>,
    value_2: diesel::expression::AsExpression<V2> {
    jsonb_object_2_utils::jsonb_object_2 {
        key_1: key_1.as_expression(),
        value_1: value_1.as_expression(),
        key_2: key_2.as_expression(),
        value_2: value_2.as_expression(),
        K1: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
        K2: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_object_2()`](fn@jsonb_object_2)"]
pub type jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> =
    jsonb_object_2_utils::jsonb_object_2<K1, V1, K2, V2,
    <key_1 as diesel::expression::AsExpression<K1>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <key_2 as diesel::expression::AsExpression<K2>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_object_2_return_type {
    #[doc =
    "Return type of the [`jsonb_object_2()`](fn@super::jsonb_object_2) SQL function."]
    pub type jsonb_object_2<key_1, value_1, key_2, value_2> =
        super::jsonb_object_2<<key_1 as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType,
        <key_2 as diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, key_1, value_1,
        key_2, value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_object_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2,
        value_2> {
        pub(in super) key_1: key_1,
        pub(in super) value_1: value_1,
        pub(in super) key_2: key_2,
        pub(in super) value_2: value_2,
        pub(in super) K1: ::core::marker::PhantomData<K1>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) K2: ::core::marker::PhantomData<K2>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<K1, V1, K2, V2, key_1, value_1, key_2, value_2, __Rhs>
                ::core::ops::Add<__Rhs> for
                jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, K2, V2, key_1, value_1, key_2, value_2, __Rhs>
                ::core::ops::Sub<__Rhs> for
                jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, K2, V2, key_1, value_1, key_2, value_2, __Rhs>
                ::core::ops::Mul<__Rhs> for
                jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<K1, V1, K2, V2, key_1, value_1, key_2, value_2, __Rhs>
                ::core::ops::Div<__Rhs> for
                jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<K1: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        K2: ::core::fmt::Debug, V2: ::core::fmt::Debug,
        key_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug,
        key_2: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            let names: &'static _ =
                &["key_1", "value_1", "key_2", "value_2", "K1", "V1", "K2",
                            "V2"];
            let values: &[&dyn ::core::fmt::Debug] =
                &[&self.key_1, &self.value_1, &self.key_2, &self.value_2,
                            &self.K1, &self.V1, &self.K2, &&self.V2];
            ::core::fmt::Formatter::debug_struct_fields_finish(f,
                "jsonb_object_2", names, values)
        }
    }
    #[automatically_derived]
    impl<K1: ::core::clone::Clone, V1: ::core::clone::Clone,
        K2: ::core::clone::Clone, V2: ::core::clone::Clone,
        key_1: ::core::clone::Clone, value_1: ::core::clone::Clone,
        key_2: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> {
        #[inline]
        fn clone(&self)
            ->
                jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2,
                value_2> {
            jsonb_object_2 {
                key_1: ::core::clone::Clone::clone(&self.key_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                key_2: ::core::clone::Clone::clone(&self.key_2),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                K1: ::core::clone::Clone::clone(&self.K1),
                V1: ::core::clone::Clone::clone(&self.V1),
                K2: ::core::clone::Clone::clone(&self.K2),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<K1: ::core::marker::Copy, V1: ::core::marker::Copy,
        K2: ::core::marker::Copy, V2: ::core::marker::Copy,
        key_1: ::core::marker::Copy, value_1: ::core::marker::Copy,
        key_2: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<K1: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                K2: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                key_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                key_2: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2>
                {
                type QueryId =
                    jsonb_object_2<<K1 as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <K2 as diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <key_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <key_2 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <K1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                    &&
                                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                &&
                                                <K2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                            &&
                                            <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                        &&
                                        <key_1 as
                                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                    <value_1 as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <key_2 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <K1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                    ||
                                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                ||
                                                <K2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                            ||
                                            <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                        ||
                                        <key_1 as
                                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <value_1 as
                                        diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <key_2 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_object_2()`](fn@jsonb_object_2)"]
    pub type HelperType<K1, V1, K2, V2, key_1, value_1, key_2, value_2> =
        jsonb_object_2<K1, V1, K2, V2,
        <key_1 as AsExpression<K1>>::Expression,
        <value_1 as AsExpression<V1>>::Expression,
        <key_2 as AsExpression<K2>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2> Expression for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        (key_1, value_1, key_2, value_2): Expression {
        type SqlType = Jsonb;
    }
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        key_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        key_2: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        key_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>,
        key_2: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        __DieselInternal: diesel::backend::Backend,
        key_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal>,
        key_2: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_object";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.key_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.key_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.key_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.key_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        key_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        key_2: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<key_1, value_1, key_2,
        value_2>(key_1, value_1, key_2, value_2);
    const _: () =
        {
            use diesel;
            impl<key_1, value_1, key_2, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<key_1, value_1, key_2, value_2> where
                key_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                key_2: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <key_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<key_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<key_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<key_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<key_2 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<<key_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<key_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<K1: NotBlob<IsNull = is_nullable::NotNull>, V1: NotBlob,
        K2: NotBlob<IsNull = is_nullable::NotNull>, V2: NotBlob, key_1,
        value_1, key_2, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        jsonb_object_2<K1, V1, K2, V2, key_1, value_1, key_2, value_2> where
        __Derived<key_1, value_1, key_2,
        value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<key_1, value_1, key_2, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __jsonb_object_return_types {
    #[doc(inline)]
    pub use super::__jsonb_object_0_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_object_1_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_object_2_return_type::*;
}
#[doc =
" The json_group_object(NAME,VALUE) function returns a JSON object comprised of all NAME/VALUE pairs in"]
#[doc = " the aggregation."]
#[doc = ""]
#[doc =
" A potential edge case in this function arises when `names` contains duplicate elements."]
#[doc =
" In such case, the result will include all duplicates (e.g., `{\"key\": 1, \"key\": 2, \"key\": 3}`)."]
#[doc =
" Note that any duplicate entries in the resulting JSON will be removed during deserialization."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " ## Aggregate Function Expression"]
#[doc = ""]
#[doc =
" This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details."]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ## Normal function usage"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::Text;"]
#[doc = " #     use serde_json::json;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = animals.select(json_group_object(species, name)).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"dog\":\"Jack\",\"spider\":null}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[doc = ""]
#[doc = " ## Aggregate function expression"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::Text;"]
#[doc = " #     use serde_json::json;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #"]
#[doc =
" #     let version = diesel::select(sql::<Text>(\"sqlite_version();\"))"]
#[doc = " #         .get_result::<String>(connection)?;"]
#[doc = " #"]
#[doc =
" #     let version_components: Vec<&str> = version.split(\'.\').collect();"]
#[doc = " #     let major: u32 = version_components[0].parse().unwrap();"]
#[doc = " #     let minor: u32 = version_components[1].parse().unwrap();"]
#[doc = " #"]
#[doc = " #     if major < 3 || minor < 38 {"]
#[doc =
" #         println!(\"SQLite version is too old, skipping the test.\");"]
#[doc = " #         return Ok(());"]
#[doc = " #     }"]
#[doc = " #"]
#[doc =
" let result = animals.select(json_group_object(species, name).aggregate_filter(legs.lt(8))).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"dog\":\"Jack\"}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[doc = ""]
#[doc = " # See also"]
#[doc =
" - [`jsonb_group_object`](jsonb_group_object()) will return data in JSONB format instead of JSON."]
#[doc =
" - [`json_group_array`](json_group_array()) will return JSON array instead of object."]
#[allow(non_camel_case_types)]
pub fn json_group_object<N: SqlType<IsNull = is_nullable::NotNull> +
    SingleValue, V: SqlType + SingleValue, names,
    values>(names: names, values: values)
    -> json_group_object<N, V, names, values> where
    names: diesel::expression::AsExpression<N>,
    values: diesel::expression::AsExpression<V> {
    json_group_object_utils::json_group_object {
        names: names.as_expression(),
        values: values.as_expression(),
        N: ::core::marker::PhantomData,
        V: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_group_object()`](fn@json_group_object)"]
pub type json_group_object<N, V, names, values> =
    json_group_object_utils::json_group_object<N, V,
    <names as diesel::expression::AsExpression<N>>::Expression,
    <values as diesel::expression::AsExpression<V>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_group_object_return_type {
    #[doc =
    "Return type of the [`json_group_object()`](fn@super::json_group_object) SQL function."]
    pub type json_group_object<names, values> =
        super::json_group_object<<names as
        diesel::expression::Expression>::SqlType,
        <values as diesel::expression::Expression>::SqlType, names, values>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_group_object_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_group_object<N, V, names, values> {
        pub(in super) names: names,
        pub(in super) values: values,
        pub(in super) N: ::core::marker::PhantomData<N>,
        pub(in super) V: ::core::marker::PhantomData<V>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<N, V, names, values, __Rhs> ::core::ops::Add<__Rhs> for
                json_group_object<N, V, names, values> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<N, V, names, values, __Rhs> ::core::ops::Sub<__Rhs> for
                json_group_object<N, V, names, values> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<N, V, names, values, __Rhs> ::core::ops::Mul<__Rhs> for
                json_group_object<N, V, names, values> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<N, V, names, values, __Rhs> ::core::ops::Div<__Rhs> for
                json_group_object<N, V, names, values> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<N: ::core::fmt::Debug, V: ::core::fmt::Debug,
        names: ::core::fmt::Debug, values: ::core::fmt::Debug>
        ::core::fmt::Debug for json_group_object<N, V, names, values> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "json_group_object", "names", &self.names, "values",
                &self.values, "N", &self.N, "V", &&self.V)
        }
    }
    #[automatically_derived]
    impl<N: ::core::clone::Clone, V: ::core::clone::Clone,
        names: ::core::clone::Clone, values: ::core::clone::Clone>
        ::core::clone::Clone for json_group_object<N, V, names, values> {
        #[inline]
        fn clone(&self) -> json_group_object<N, V, names, values> {
            json_group_object {
                names: ::core::clone::Clone::clone(&self.names),
                values: ::core::clone::Clone::clone(&self.values),
                N: ::core::clone::Clone::clone(&self.N),
                V: ::core::clone::Clone::clone(&self.V),
            }
        }
    }
    #[automatically_derived]
    impl<N: ::core::marker::Copy, V: ::core::marker::Copy,
        names: ::core::marker::Copy, values: ::core::marker::Copy>
        ::core::marker::Copy for json_group_object<N, V, names, values> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<N: diesel::query_builder::QueryId,
                V: diesel::query_builder::QueryId,
                names: diesel::query_builder::QueryId,
                values: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_group_object<N, V, names, values> {
                type QueryId =
                    json_group_object<<N as
                    diesel::query_builder::QueryId>::QueryId,
                    <V as diesel::query_builder::QueryId>::QueryId,
                    <names as diesel::query_builder::QueryId>::QueryId,
                    <values as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <N as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <V as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <names as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <values as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <N as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <V as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <names as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <values as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`json_group_object()`](fn@json_group_object)"]
    pub type HelperType<N, V, names, values> =
        json_group_object<N, V, <names as AsExpression<N>>::Expression,
        <values as AsExpression<V>>::Expression>;
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values> Expression for
        json_group_object<N, V, names, values> where
        (names, values): Expression {
        type SqlType = Json;
    }
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_group_object<N, V, names, values> where
        names: SelectableExpression<__DieselInternal>,
        values: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        json_group_object<N, V, names, values> where
        names: AppearsOnTable<__DieselInternal>,
        values: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        json_group_object<N, V, names, values> where
        __DieselInternal: diesel::backend::Backend,
        names: QueryFragment<__DieselInternal>,
        values: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_group_object";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.names.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.names.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.values.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.values.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values> QueryFragment<crate::sqlite::Sqlite> for
        json_group_object<N, V, names, values> where
        names: QueryFragment<crate::sqlite::Sqlite>,
        values: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        json_group_object<N, V, names, values> {
        type IsAggregate = diesel::expression::is_aggregate::Yes;
    }
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values> IsAggregateFunction for
        json_group_object<N, V, names, values> {}
}
#[doc =
" The jsonb_group_object(NAME,VALUE) function returns a JSONB object comprised of all NAME/VALUE pairs in"]
#[doc = " the aggregation."]
#[doc = ""]
#[doc =
" A potential edge case in this function arises when `names` contains duplicate elements."]
#[doc =
" In such case, the result will include all duplicates (e.g., `{\"key\": 1, \"key\": 2, \"key\": 3}`)."]
#[doc =
" Note that any duplicate entries in the resulting JSONB will be removed during deserialization."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " ## Aggregate Function Expression"]
#[doc = ""]
#[doc =
" This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details."]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ## Normal function usage"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::Text;"]
#[doc = " #     use serde_json::json;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = animals.select(jsonb_group_object(species, name)).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"dog\":\"Jack\",\"spider\":null}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[doc = ""]
#[doc = " ## Aggregate function expression"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::Text;"]
#[doc = " #     use serde_json::json;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #"]
#[doc =
" #     let version = diesel::select(sql::<Text>(\"sqlite_version();\"))"]
#[doc = " #         .get_result::<String>(connection)?;"]
#[doc = " #"]
#[doc =
" #     let version_components: Vec<&str> = version.split(\'.\').collect();"]
#[doc = " #     let major: u32 = version_components[0].parse().unwrap();"]
#[doc = " #     let minor: u32 = version_components[1].parse().unwrap();"]
#[doc = " #"]
#[doc = " #     if major < 3 || minor < 38 {"]
#[doc =
" #         println!(\"SQLite version is too old, skipping the test.\");"]
#[doc = " #         return Ok(());"]
#[doc = " #     }"]
#[doc = " #"]
#[doc =
" let result = animals.select(jsonb_group_object(species, name).aggregate_filter(legs.lt(8))).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"dog\":\"Jack\"}), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[doc = ""]
#[doc = " # See also"]
#[doc =
" - [`json_group_object`](jsonb_group_array()) will return data in JSON format instead of JSONB."]
#[doc =
" - [`jsonb_group_array`](jsonb_group_array()) will return JSONB array instead of object."]
#[allow(non_camel_case_types)]
pub fn jsonb_group_object<N: SqlType<IsNull = is_nullable::NotNull> +
    SingleValue, V: SqlType + SingleValue, names,
    values>(names: names, values: values)
    -> jsonb_group_object<N, V, names, values> where
    names: diesel::expression::AsExpression<N>,
    values: diesel::expression::AsExpression<V> {
    jsonb_group_object_utils::jsonb_group_object {
        names: names.as_expression(),
        values: values.as_expression(),
        N: ::core::marker::PhantomData,
        V: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_group_object()`](fn@jsonb_group_object)"]
pub type jsonb_group_object<N, V, names, values> =
    jsonb_group_object_utils::jsonb_group_object<N, V,
    <names as diesel::expression::AsExpression<N>>::Expression,
    <values as diesel::expression::AsExpression<V>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_group_object_return_type {
    #[doc =
    "Return type of the [`jsonb_group_object()`](fn@super::jsonb_group_object) SQL function."]
    pub type jsonb_group_object<names, values> =
        super::jsonb_group_object<<names as
        diesel::expression::Expression>::SqlType,
        <values as diesel::expression::Expression>::SqlType, names, values>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_group_object_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_group_object<N, V, names, values> {
        pub(in super) names: names,
        pub(in super) values: values,
        pub(in super) N: ::core::marker::PhantomData<N>,
        pub(in super) V: ::core::marker::PhantomData<V>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<N, V, names, values, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_group_object<N, V, names, values> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<N, V, names, values, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_group_object<N, V, names, values> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<N, V, names, values, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_group_object<N, V, names, values> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<N, V, names, values, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_group_object<N, V, names, values> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<N: ::core::fmt::Debug, V: ::core::fmt::Debug,
        names: ::core::fmt::Debug, values: ::core::fmt::Debug>
        ::core::fmt::Debug for jsonb_group_object<N, V, names, values> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "jsonb_group_object", "names", &self.names, "values",
                &self.values, "N", &self.N, "V", &&self.V)
        }
    }
    #[automatically_derived]
    impl<N: ::core::clone::Clone, V: ::core::clone::Clone,
        names: ::core::clone::Clone, values: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_group_object<N, V, names, values> {
        #[inline]
        fn clone(&self) -> jsonb_group_object<N, V, names, values> {
            jsonb_group_object {
                names: ::core::clone::Clone::clone(&self.names),
                values: ::core::clone::Clone::clone(&self.values),
                N: ::core::clone::Clone::clone(&self.N),
                V: ::core::clone::Clone::clone(&self.V),
            }
        }
    }
    #[automatically_derived]
    impl<N: ::core::marker::Copy, V: ::core::marker::Copy,
        names: ::core::marker::Copy, values: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_group_object<N, V, names, values> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<N: diesel::query_builder::QueryId,
                V: diesel::query_builder::QueryId,
                names: diesel::query_builder::QueryId,
                values: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_group_object<N, V, names, values> {
                type QueryId =
                    jsonb_group_object<<N as
                    diesel::query_builder::QueryId>::QueryId,
                    <V as diesel::query_builder::QueryId>::QueryId,
                    <names as diesel::query_builder::QueryId>::QueryId,
                    <values as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <N as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <V as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <names as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <values as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <N as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <V as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <names as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <values as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc =
    "The return type of [`jsonb_group_object()`](fn@jsonb_group_object)"]
    pub type HelperType<N, V, names, values> =
        jsonb_group_object<N, V, <names as AsExpression<N>>::Expression,
        <values as AsExpression<V>>::Expression>;
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values> Expression for
        jsonb_group_object<N, V, names, values> where
        (names, values): Expression {
        type SqlType = Jsonb;
    }
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_group_object<N, V, names, values> where
        names: SelectableExpression<__DieselInternal>,
        values: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        jsonb_group_object<N, V, names, values> where
        names: AppearsOnTable<__DieselInternal>,
        values: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        jsonb_group_object<N, V, names, values> where
        __DieselInternal: diesel::backend::Backend,
        names: QueryFragment<__DieselInternal>,
        values: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_group_object";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.names.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.names.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.values.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.values.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_group_object<N, V, names, values> where
        names: QueryFragment<crate::sqlite::Sqlite>,
        values: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        jsonb_group_object<N, V, names, values> {
        type IsAggregate = diesel::expression::is_aggregate::Yes;
    }
    impl<N: SqlType<IsNull = is_nullable::NotNull> + SingleValue, V: SqlType +
        SingleValue, names, values> IsAggregateFunction for
        jsonb_group_object<N, V, names, values> {}
}
#[doc =
" The `json_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array"]
#[doc =
" that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this"]
#[doc = " function."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_array_0`, `json_array_1`, ... `json_array_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_array")]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the"]
#[doc =
" argument is the output from another json function, then it is stored as JSON. This allows calls to"]
#[doc =
" `json_array()` and `json_object()` to be nested. The [`json()`] function can also be used to force"]
#[doc = " strings to be recognized as JSON."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Double};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(json_array_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([]), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_array_1::<Text, _>(\"abc\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\"]), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_2::<Text, Double, _, _>(\"abc\", 3.1415))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\", 3.1415]), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_array_0() -> json_array_0 where  {
    json_array_0_utils::json_array_0 {}
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_array_0()`](fn@json_array_0)"]
pub type json_array_0 = json_array_0_utils::json_array_0<>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_array_0_return_type {
    #[doc =
    "Return type of the [`json_array_0()`](fn@super::json_array_0) SQL function."]
    pub type json_array_0 = super::json_array_0<>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_array_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_array_0 {}
    #[automatically_derived]
    impl ::core::fmt::Debug for json_array_0 {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::write_str(f, "json_array_0")
        }
    }
    #[automatically_derived]
    #[doc(hidden)]
    unsafe impl ::core::clone::TrivialClone for json_array_0 { }
    #[automatically_derived]
    impl ::core::clone::Clone for json_array_0 {
        #[inline]
        fn clone(&self) -> json_array_0 { *self }
    }
    #[automatically_derived]
    impl ::core::marker::Copy for json_array_0 { }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl diesel::query_builder::QueryId for json_array_0 {
                type QueryId = json_array_0<>;
                const HAS_STATIC_QUERY_ID: bool = true;
                const IS_WINDOW_FUNCTION: bool = false;
            }
        };
    #[doc = "The return type of [`json_array_0()`](fn@json_array_0)"]
    pub type HelperType = json_array_0<>;
    impl Expression for json_array_0 where  {
        type SqlType = Json;
    }
    impl<__DieselInternal> SelectableExpression<__DieselInternal> for
        json_array_0 where Self: AppearsOnTable<__DieselInternal> {}
    impl<__DieselInternal> AppearsOnTable<__DieselInternal> for json_array_0
        where Self: Expression {}
    impl<__DieselInternal> FunctionFragment<__DieselInternal> for json_array_0
        where __DieselInternal: diesel::backend::Backend {
        const FUNCTION_NAME: &'static str = "json_array";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            Ok(())
        }
    }
    impl QueryFragment<crate::sqlite::Sqlite> for json_array_0 where  {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived();
    const _: () =
        {
            use diesel;
            impl<__GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived {
                type IsAggregate = diesel::expression::is_aggregate::Never;
            }
        };
    impl<__DieselInternal> ValidGrouping<__DieselInternal> for json_array_0
        where __Derived<>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array"]
#[doc =
" that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this"]
#[doc = " function."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_array_0`, `json_array_1`, ... `json_array_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_array")]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the"]
#[doc =
" argument is the output from another json function, then it is stored as JSON. This allows calls to"]
#[doc =
" `json_array()` and `json_object()` to be nested. The [`json()`] function can also be used to force"]
#[doc = " strings to be recognized as JSON."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Double};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(json_array_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([]), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_array_1::<Text, _>(\"abc\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\"]), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_2::<Text, Double, _, _>(\"abc\", 3.1415))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\", 3.1415]), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_array_1<V1: NotBlob, value_1>(value_1: value_1)
    -> json_array_1<V1, value_1> where
    value_1: diesel::expression::AsExpression<V1> {
    json_array_1_utils::json_array_1 {
        value_1: value_1.as_expression(),
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_array_1()`](fn@json_array_1)"]
pub type json_array_1<V1, value_1> =
    json_array_1_utils::json_array_1<V1,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_array_1_return_type {
    #[doc =
    "Return type of the [`json_array_1()`](fn@super::json_array_1) SQL function."]
    pub type json_array_1<value_1> =
        super::json_array_1<<value_1 as
        diesel::expression::Expression>::SqlType, value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_array_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_array_1<V1, value_1> {
        pub(in super) value_1: value_1,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<V1, value_1, __Rhs> ::core::ops::Add<__Rhs> for
                json_array_1<V1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<V1, value_1, __Rhs> ::core::ops::Sub<__Rhs> for
                json_array_1<V1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<V1, value_1, __Rhs> ::core::ops::Mul<__Rhs> for
                json_array_1<V1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<V1, value_1, __Rhs> ::core::ops::Div<__Rhs> for
                json_array_1<V1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<V1: ::core::fmt::Debug, value_1: ::core::fmt::Debug>
        ::core::fmt::Debug for json_array_1<V1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_array_1", "value_1", &self.value_1, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<V1: ::core::clone::Clone, value_1: ::core::clone::Clone>
        ::core::clone::Clone for json_array_1<V1, value_1> {
        #[inline]
        fn clone(&self) -> json_array_1<V1, value_1> {
            json_array_1 {
                value_1: ::core::clone::Clone::clone(&self.value_1),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<V1: ::core::marker::Copy, value_1: ::core::marker::Copy>
        ::core::marker::Copy for json_array_1<V1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<V1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_array_1<V1, value_1> {
                type QueryId =
                    json_array_1<<V1 as
                    diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_array_1()`](fn@json_array_1)"]
    pub type HelperType<V1, value_1> =
        json_array_1<V1, <value_1 as AsExpression<V1>>::Expression>;
    impl<V1: NotBlob, value_1> Expression for json_array_1<V1, value_1> where
        (value_1): Expression {
        type SqlType = Json;
    }
    impl<V1: NotBlob, value_1, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_array_1<V1, value_1>
        where value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<V1: NotBlob, value_1, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_array_1<V1, value_1> where
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<V1: NotBlob, value_1, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_array_1<V1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_array";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<V1: NotBlob, value_1> QueryFragment<crate::sqlite::Sqlite> for
        json_array_1<V1, value_1> where
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<value_1>(value_1);
    const _: () =
        {
            use diesel;
            impl<value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<value_1> where
                value_1: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<V1: NotBlob, value_1, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_array_1<V1, value_1> where
        __Derived<value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array"]
#[doc =
" that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this"]
#[doc = " function."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_array_0`, `json_array_1`, ... `json_array_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_array")]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the"]
#[doc =
" argument is the output from another json function, then it is stored as JSON. This allows calls to"]
#[doc =
" `json_array()` and `json_object()` to be nested. The [`json()`] function can also be used to force"]
#[doc = " strings to be recognized as JSON."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Double};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(json_array_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([]), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_array_1::<Text, _>(\"abc\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\"]), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_array_2::<Text, Double, _, _>(\"abc\", 3.1415))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\", 3.1415]), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_array_2<V1: NotBlob, V2: NotBlob, value_1,
    value_2>(value_1: value_1, value_2: value_2)
    -> json_array_2<V1, V2, value_1, value_2> where
    value_1: diesel::expression::AsExpression<V1>,
    value_2: diesel::expression::AsExpression<V2> {
    json_array_2_utils::json_array_2 {
        value_1: value_1.as_expression(),
        value_2: value_2.as_expression(),
        V1: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_array_2()`](fn@json_array_2)"]
pub type json_array_2<V1, V2, value_1, value_2> =
    json_array_2_utils::json_array_2<V1, V2,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_array_2_return_type {
    #[doc =
    "Return type of the [`json_array_2()`](fn@super::json_array_2) SQL function."]
    pub type json_array_2<value_1, value_2> =
        super::json_array_2<<value_1 as
        diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, value_1,
        value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_array_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_array_2<V1, V2, value_1, value_2> {
        pub(in super) value_1: value_1,
        pub(in super) value_2: value_2,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<V1, V2, value_1, value_2, __Rhs> ::core::ops::Add<__Rhs> for
                json_array_2<V1, V2, value_1, value_2> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<V1, V2, value_1, value_2, __Rhs> ::core::ops::Sub<__Rhs> for
                json_array_2<V1, V2, value_1, value_2> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<V1, V2, value_1, value_2, __Rhs> ::core::ops::Mul<__Rhs> for
                json_array_2<V1, V2, value_1, value_2> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<V1, V2, value_1, value_2, __Rhs> ::core::ops::Div<__Rhs> for
                json_array_2<V1, V2, value_1, value_2> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<V1: ::core::fmt::Debug, V2: ::core::fmt::Debug,
        value_1: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for json_array_2<V1, V2, value_1, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "json_array_2", "value_1", &self.value_1, "value_2",
                &self.value_2, "V1", &self.V1, "V2", &&self.V2)
        }
    }
    #[automatically_derived]
    impl<V1: ::core::clone::Clone, V2: ::core::clone::Clone,
        value_1: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for json_array_2<V1, V2, value_1, value_2> {
        #[inline]
        fn clone(&self) -> json_array_2<V1, V2, value_1, value_2> {
            json_array_2 {
                value_1: ::core::clone::Clone::clone(&self.value_1),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                V1: ::core::clone::Clone::clone(&self.V1),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<V1: ::core::marker::Copy, V2: ::core::marker::Copy,
        value_1: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for json_array_2<V1, V2, value_1, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<V1: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_array_2<V1, V2, value_1, value_2> {
                type QueryId =
                    json_array_2<<V1 as
                    diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <value_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <value_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_array_2()`](fn@json_array_2)"]
    pub type HelperType<V1, V2, value_1, value_2> =
        json_array_2<V1, V2, <value_1 as AsExpression<V1>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2> Expression for
        json_array_2<V1, V2, value_1, value_2> where
        (value_1, value_2): Expression {
        type SqlType = Json;
    }
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_array_2<V1, V2, value_1, value_2> where
        value_1: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        json_array_2<V1, V2, value_1, value_2> where
        value_1: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        json_array_2<V1, V2, value_1, value_2> where
        __DieselInternal: diesel::backend::Backend,
        value_1: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_array";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2>
        QueryFragment<crate::sqlite::Sqlite> for
        json_array_2<V1, V2, value_1, value_2> where
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<value_1, value_2>(value_1, value_2);
    const _: () =
        {
            use diesel;
            impl<value_1, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<value_1, value_2> where
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        json_array_2<V1, V2, value_1, value_2> where
        __Derived<value_1, value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<value_1, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __json_array_return_types {
    #[doc(inline)]
    pub use super::__json_array_0_return_type::*;
    #[doc(inline)]
    pub use super::__json_array_1_return_type::*;
    #[doc(inline)]
    pub use super::__json_array_2_return_type::*;
}
#[doc =
" The `jsonb_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array"]
#[doc =
" that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this"]
#[doc = " function."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_array_0`, `jsonb_array_1`, ... `jsonb_array_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_array")]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the"]
#[doc =
" argument is the output from another json function, then it is stored as JSON. This allows calls to"]
#[doc =
" `jsonb_array()` and `jsonb_object()` to be nested. The [`json()`] function can also be used to force"]
#[doc = " strings to be recognized as JSON."]
#[doc = ""]
#[doc =
" This function works just like the [`json_array()`](json_array_1()) function except that it returns the"]
#[doc =
" constructed JSON array in the SQLite\'s private JSONB format rather than in the standard RFC 8259 text"]
#[doc = " format."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Double};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(jsonb_array_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([]), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(jsonb_array_1::<Text, _>(\"abc\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\"]), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_array_2::<Text, Double, _, _>(\"abc\", 3.1415))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\", 3.1415]), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_array_0() -> jsonb_array_0 where  {
    jsonb_array_0_utils::jsonb_array_0 {}
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_array_0()`](fn@jsonb_array_0)"]
pub type jsonb_array_0 = jsonb_array_0_utils::jsonb_array_0<>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_array_0_return_type {
    #[doc =
    "Return type of the [`jsonb_array_0()`](fn@super::jsonb_array_0) SQL function."]
    pub type jsonb_array_0 = super::jsonb_array_0<>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_array_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_array_0 {}
    #[automatically_derived]
    impl ::core::fmt::Debug for jsonb_array_0 {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::write_str(f, "jsonb_array_0")
        }
    }
    #[automatically_derived]
    #[doc(hidden)]
    unsafe impl ::core::clone::TrivialClone for jsonb_array_0 { }
    #[automatically_derived]
    impl ::core::clone::Clone for jsonb_array_0 {
        #[inline]
        fn clone(&self) -> jsonb_array_0 { *self }
    }
    #[automatically_derived]
    impl ::core::marker::Copy for jsonb_array_0 { }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl diesel::query_builder::QueryId for jsonb_array_0 {
                type QueryId = jsonb_array_0<>;
                const HAS_STATIC_QUERY_ID: bool = true;
                const IS_WINDOW_FUNCTION: bool = false;
            }
        };
    #[doc = "The return type of [`jsonb_array_0()`](fn@jsonb_array_0)"]
    pub type HelperType = jsonb_array_0<>;
    impl Expression for jsonb_array_0 where  {
        type SqlType = Jsonb;
    }
    impl<__DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_array_0 where Self: AppearsOnTable<__DieselInternal> {}
    impl<__DieselInternal> AppearsOnTable<__DieselInternal> for jsonb_array_0
        where Self: Expression {}
    impl<__DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_array_0 where __DieselInternal: diesel::backend::Backend {
        const FUNCTION_NAME: &'static str = "jsonb_array";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            Ok(())
        }
    }
    impl QueryFragment<crate::sqlite::Sqlite> for jsonb_array_0 where  {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived();
    const _: () =
        {
            use diesel;
            impl<__GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived {
                type IsAggregate = diesel::expression::is_aggregate::Never;
            }
        };
    impl<__DieselInternal> ValidGrouping<__DieselInternal> for jsonb_array_0
        where __Derived<>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array"]
#[doc =
" that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this"]
#[doc = " function."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_array_0`, `jsonb_array_1`, ... `jsonb_array_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_array")]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the"]
#[doc =
" argument is the output from another json function, then it is stored as JSON. This allows calls to"]
#[doc =
" `jsonb_array()` and `jsonb_object()` to be nested. The [`json()`] function can also be used to force"]
#[doc = " strings to be recognized as JSON."]
#[doc = ""]
#[doc =
" This function works just like the [`json_array()`](json_array_1()) function except that it returns the"]
#[doc =
" constructed JSON array in the SQLite\'s private JSONB format rather than in the standard RFC 8259 text"]
#[doc = " format."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Double};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(jsonb_array_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([]), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(jsonb_array_1::<Text, _>(\"abc\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\"]), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_array_2::<Text, Double, _, _>(\"abc\", 3.1415))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\", 3.1415]), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_array_1<V1: NotBlob, value_1>(value_1: value_1)
    -> jsonb_array_1<V1, value_1> where
    value_1: diesel::expression::AsExpression<V1> {
    jsonb_array_1_utils::jsonb_array_1 {
        value_1: value_1.as_expression(),
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_array_1()`](fn@jsonb_array_1)"]
pub type jsonb_array_1<V1, value_1> =
    jsonb_array_1_utils::jsonb_array_1<V1,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_array_1_return_type {
    #[doc =
    "Return type of the [`jsonb_array_1()`](fn@super::jsonb_array_1) SQL function."]
    pub type jsonb_array_1<value_1> =
        super::jsonb_array_1<<value_1 as
        diesel::expression::Expression>::SqlType, value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_array_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_array_1<V1, value_1> {
        pub(in super) value_1: value_1,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<V1, value_1, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_array_1<V1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<V1, value_1, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_array_1<V1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<V1, value_1, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_array_1<V1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<V1, value_1, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_array_1<V1, value_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<V1: ::core::fmt::Debug, value_1: ::core::fmt::Debug>
        ::core::fmt::Debug for jsonb_array_1<V1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "jsonb_array_1", "value_1", &self.value_1, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<V1: ::core::clone::Clone, value_1: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_array_1<V1, value_1> {
        #[inline]
        fn clone(&self) -> jsonb_array_1<V1, value_1> {
            jsonb_array_1 {
                value_1: ::core::clone::Clone::clone(&self.value_1),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<V1: ::core::marker::Copy, value_1: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_array_1<V1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<V1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for jsonb_array_1<V1, value_1>
                {
                type QueryId =
                    jsonb_array_1<<V1 as
                    diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_array_1()`](fn@jsonb_array_1)"]
    pub type HelperType<V1, value_1> =
        jsonb_array_1<V1, <value_1 as AsExpression<V1>>::Expression>;
    impl<V1: NotBlob, value_1> Expression for jsonb_array_1<V1, value_1> where
        (value_1): Expression {
        type SqlType = Jsonb;
    }
    impl<V1: NotBlob, value_1, __DieselInternal>
        SelectableExpression<__DieselInternal> for jsonb_array_1<V1, value_1>
        where value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<V1: NotBlob, value_1, __DieselInternal>
        AppearsOnTable<__DieselInternal> for jsonb_array_1<V1, value_1> where
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<V1: NotBlob, value_1, __DieselInternal>
        FunctionFragment<__DieselInternal> for jsonb_array_1<V1, value_1>
        where __DieselInternal: diesel::backend::Backend,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_array";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<V1: NotBlob, value_1> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_array_1<V1, value_1> where
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<value_1>(value_1);
    const _: () =
        {
            use diesel;
            impl<value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<value_1> where
                value_1: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<V1: NotBlob, value_1, __DieselInternal>
        ValidGrouping<__DieselInternal> for jsonb_array_1<V1, value_1> where
        __Derived<value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array"]
#[doc =
" that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this"]
#[doc = " function."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_array_0`, `jsonb_array_1`, ... `jsonb_array_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_array")]
#[doc = ""]
#[doc =
" An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the"]
#[doc =
" argument is the output from another json function, then it is stored as JSON. This allows calls to"]
#[doc =
" `jsonb_array()` and `jsonb_object()` to be nested. The [`json()`] function can also be used to force"]
#[doc = " strings to be recognized as JSON."]
#[doc = ""]
#[doc =
" This function works just like the [`json_array()`](json_array_1()) function except that it returns the"]
#[doc =
" constructed JSON array in the SQLite\'s private JSONB format rather than in the standard RFC 8259 text"]
#[doc = " format."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Text, Double};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc =
" let result = diesel::select(jsonb_array_0()).get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([]), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(jsonb_array_1::<Text, _>(\"abc\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\"]), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_array_2::<Text, Double, _, _>(\"abc\", 3.1415))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\"abc\", 3.1415]), result);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_array_2<V1: NotBlob, V2: NotBlob, value_1,
    value_2>(value_1: value_1, value_2: value_2)
    -> jsonb_array_2<V1, V2, value_1, value_2> where
    value_1: diesel::expression::AsExpression<V1>,
    value_2: diesel::expression::AsExpression<V2> {
    jsonb_array_2_utils::jsonb_array_2 {
        value_1: value_1.as_expression(),
        value_2: value_2.as_expression(),
        V1: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_array_2()`](fn@jsonb_array_2)"]
pub type jsonb_array_2<V1, V2, value_1, value_2> =
    jsonb_array_2_utils::jsonb_array_2<V1, V2,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_array_2_return_type {
    #[doc =
    "Return type of the [`jsonb_array_2()`](fn@super::jsonb_array_2) SQL function."]
    pub type jsonb_array_2<value_1, value_2> =
        super::jsonb_array_2<<value_1 as
        diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, value_1,
        value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_array_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_array_2<V1, V2, value_1, value_2> {
        pub(in super) value_1: value_1,
        pub(in super) value_2: value_2,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<V1, V2, value_1, value_2, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_array_2<V1, V2, value_1, value_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<V1, V2, value_1, value_2, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_array_2<V1, V2, value_1, value_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<V1, V2, value_1, value_2, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_array_2<V1, V2, value_1, value_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<V1, V2, value_1, value_2, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_array_2<V1, V2, value_1, value_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<V1: ::core::fmt::Debug, V2: ::core::fmt::Debug,
        value_1: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for jsonb_array_2<V1, V2, value_1, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "jsonb_array_2", "value_1", &self.value_1, "value_2",
                &self.value_2, "V1", &self.V1, "V2", &&self.V2)
        }
    }
    #[automatically_derived]
    impl<V1: ::core::clone::Clone, V2: ::core::clone::Clone,
        value_1: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_array_2<V1, V2, value_1, value_2> {
        #[inline]
        fn clone(&self) -> jsonb_array_2<V1, V2, value_1, value_2> {
            jsonb_array_2 {
                value_1: ::core::clone::Clone::clone(&self.value_1),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                V1: ::core::clone::Clone::clone(&self.V1),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<V1: ::core::marker::Copy, V2: ::core::marker::Copy,
        value_1: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_array_2<V1, V2, value_1, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<V1: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_array_2<V1, V2, value_1, value_2> {
                type QueryId =
                    jsonb_array_2<<V1 as
                    diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <value_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <value_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_array_2()`](fn@jsonb_array_2)"]
    pub type HelperType<V1, V2, value_1, value_2> =
        jsonb_array_2<V1, V2, <value_1 as AsExpression<V1>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2> Expression for
        jsonb_array_2<V1, V2, value_1, value_2> where
        (value_1, value_2): Expression {
        type SqlType = Jsonb;
    }
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_array_2<V1, V2, value_1, value_2> where
        value_1: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        jsonb_array_2<V1, V2, value_1, value_2> where
        value_1: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        jsonb_array_2<V1, V2, value_1, value_2> where
        __DieselInternal: diesel::backend::Backend,
        value_1: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_array";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2>
        QueryFragment<crate::sqlite::Sqlite> for
        jsonb_array_2<V1, V2, value_1, value_2> where
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<value_1, value_2>(value_1, value_2);
    const _: () =
        {
            use diesel;
            impl<value_1, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<value_1, value_2> where
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<V1: NotBlob, V2: NotBlob, value_1, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        jsonb_array_2<V1, V2, value_1, value_2> where
        __Derived<value_1, value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<value_1, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __jsonb_array_return_types {
    #[doc(inline)]
    pub use super::__jsonb_array_0_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_array_1_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_array_2_return_type::*;
}
#[doc =
" The `json_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by"]
#[doc =
" zero or more path arguments. The `json_remove(X,P,...)` function returns a copy of the X parameter"]
#[doc =
" with all the elements identified by path arguments removed. Paths that select elements not found in X"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_remove_0`, `json_remove_1`, ... `json_remove_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_remove")]
#[doc = " are silently ignored."]
#[doc = ""]
#[doc =
" Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path"]
#[doc = " search for subsequent arguments."]
#[doc = ""]
#[doc =
" If the `json_remove(X)` function is called with no path arguments, then it returns the input X"]
#[doc = " reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_remove()` function throws an error if any of the path arguments is not a well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Text};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc = " let result = diesel::select(json_remove_0::<Json, _>(json))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'a\', \'b\', \'c\', \'d\'])), result);"]
#[doc = ""]
#[doc = " // Values are removed sequentially from left to right."]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc =
" let result = diesel::select(json_remove_2::<Json, _, _, _>(json, \"$[0]\", \"$[2]\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'b\', \'c\'])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"b\": 20})), result);"]
#[doc = ""]
#[doc = " // Paths that select not existing elements are silently ignored."]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$.c\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"a\": 10, \"b\": 20})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_remove_0<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json>(json: json) -> json_remove_0<J, json> where
    json: diesel::expression::AsExpression<J> {
    json_remove_0_utils::json_remove_0 {
        json: json.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_remove_0()`](fn@json_remove_0)"]
pub type json_remove_0<J, json> =
    json_remove_0_utils::json_remove_0<J,
    <json as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_remove_0_return_type {
    #[doc =
    "Return type of the [`json_remove_0()`](fn@super::json_remove_0) SQL function."]
    pub type json_remove_0<json> =
        super::json_remove_0<<json as
        diesel::expression::Expression>::SqlType, json>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_remove_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_remove_0<J, json> {
        pub(in super) json: json,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, __Rhs> ::core::ops::Add<__Rhs> for
                json_remove_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Sub<__Rhs> for
                json_remove_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Mul<__Rhs> for
                json_remove_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Div<__Rhs> for
                json_remove_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug> ::core::fmt::Debug
        for json_remove_0<J, json> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_remove_0", "json", &self.json, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone>
        ::core::clone::Clone for json_remove_0<J, json> {
        #[inline]
        fn clone(&self) -> json_remove_0<J, json> {
            json_remove_0 {
                json: ::core::clone::Clone::clone(&self.json),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy>
        ::core::marker::Copy for json_remove_0<J, json> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_remove_0<J, json> {
                type QueryId =
                    json_remove_0<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <json as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc = "The return type of [`json_remove_0()`](fn@json_remove_0)"]
    pub type HelperType<J, json> =
        json_remove_0<J, <json as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json>
        Expression for json_remove_0<J, json> where (json): Expression {
        type SqlType = Nullable<Json>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        __DieselInternal> SelectableExpression<__DieselInternal> for
        json_remove_0<J, json> where
        json: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_remove_0<J, json> where json: AppearsOnTable<__DieselInternal>,
        Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        __DieselInternal> FunctionFragment<__DieselInternal> for
        json_remove_0<J, json> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_remove";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json>
        QueryFragment<crate::sqlite::Sqlite> for json_remove_0<J, json> where
        json: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json>(json);
    const _: () =
        {
            use diesel;
            impl<json, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json> where
                json: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        __DieselInternal> ValidGrouping<__DieselInternal> for
        json_remove_0<J, json> where
        __Derived<json>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by"]
#[doc =
" zero or more path arguments. The `json_remove(X,P,...)` function returns a copy of the X parameter"]
#[doc =
" with all the elements identified by path arguments removed. Paths that select elements not found in X"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_remove_0`, `json_remove_1`, ... `json_remove_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_remove")]
#[doc = " are silently ignored."]
#[doc = ""]
#[doc =
" Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path"]
#[doc = " search for subsequent arguments."]
#[doc = ""]
#[doc =
" If the `json_remove(X)` function is called with no path arguments, then it returns the input X"]
#[doc = " reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_remove()` function throws an error if any of the path arguments is not a well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Text};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc = " let result = diesel::select(json_remove_0::<Json, _>(json))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'a\', \'b\', \'c\', \'d\'])), result);"]
#[doc = ""]
#[doc = " // Values are removed sequentially from left to right."]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc =
" let result = diesel::select(json_remove_2::<Json, _, _, _>(json, \"$[0]\", \"$[2]\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'b\', \'c\'])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"b\": 20})), result);"]
#[doc = ""]
#[doc = " // Paths that select not existing elements are silently ignored."]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$.c\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"a\": 10, \"b\": 20})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_remove_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, path_1>(json: json, path_1: path_1)
    -> json_remove_1<J, json, path_1> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text> {
    json_remove_1_utils::json_remove_1 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_remove_1()`](fn@json_remove_1)"]
pub type json_remove_1<J, json, path_1> =
    json_remove_1_utils::json_remove_1<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_remove_1_return_type {
    #[doc =
    "Return type of the [`json_remove_1()`](fn@super::json_remove_1) SQL function."]
    pub type json_remove_1<json, path_1> =
        super::json_remove_1<<json as
        diesel::expression::Expression>::SqlType, json, path_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_remove_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_remove_1<J, json, path_1> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, path_1, __Rhs> ::core::ops::Add<__Rhs> for
                json_remove_1<J, json, path_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, __Rhs> ::core::ops::Sub<__Rhs> for
                json_remove_1<J, json, path_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, __Rhs> ::core::ops::Mul<__Rhs> for
                json_remove_1<J, json, path_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, __Rhs> ::core::ops::Div<__Rhs> for
                json_remove_1<J, json, path_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug> ::core::fmt::Debug for
        json_remove_1<J, json, path_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "json_remove_1", "json", &self.json, "path_1", &self.path_1,
                "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone> ::core::clone::Clone for
        json_remove_1<J, json, path_1> {
        #[inline]
        fn clone(&self) -> json_remove_1<J, json, path_1> {
            json_remove_1 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy> ::core::marker::Copy for
        json_remove_1<J, json, path_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_remove_1<J, json, path_1> {
                type QueryId =
                    json_remove_1<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <path_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <path_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_remove_1()`](fn@json_remove_1)"]
    pub type HelperType<J, json, path_1> =
        json_remove_1<J, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1> Expression for json_remove_1<J, json, path_1> where
        (json, path_1): Expression {
        type SqlType = Nullable<Json>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_remove_1<J, json, path_1> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_remove_1<J, json, path_1> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_remove_1<J, json, path_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_remove";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1> QueryFragment<crate::sqlite::Sqlite> for
        json_remove_1<J, json, path_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1>(json, path_1);
    const _: () =
        {
            use diesel;
            impl<json, path_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_remove_1<J, json, path_1> where
        __Derived<json, path_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by"]
#[doc =
" zero or more path arguments. The `json_remove(X,P,...)` function returns a copy of the X parameter"]
#[doc =
" with all the elements identified by path arguments removed. Paths that select elements not found in X"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_remove_0`, `json_remove_1`, ... `json_remove_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_remove")]
#[doc = " are silently ignored."]
#[doc = ""]
#[doc =
" Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path"]
#[doc = " search for subsequent arguments."]
#[doc = ""]
#[doc =
" If the `json_remove(X)` function is called with no path arguments, then it returns the input X"]
#[doc = " reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_remove()` function throws an error if any of the path arguments is not a well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Json, Text};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc = " let result = diesel::select(json_remove_0::<Json, _>(json))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'a\', \'b\', \'c\', \'d\'])), result);"]
#[doc = ""]
#[doc = " // Values are removed sequentially from left to right."]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc =
" let result = diesel::select(json_remove_2::<Json, _, _, _>(json, \"$[0]\", \"$[2]\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'b\', \'c\'])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"b\": 20})), result);"]
#[doc = ""]
#[doc = " // Paths that select not existing elements are silently ignored."]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$.c\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"a\": 10, \"b\": 20})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(json_remove_1::<Json, _, _>(json, \"$\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_remove_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, path_1,
    path_2>(json: json, path_1: path_1, path_2: path_2)
    -> json_remove_2<J, json, path_1, path_2> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    path_2: diesel::expression::AsExpression<Text> {
    json_remove_2_utils::json_remove_2 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        path_2: path_2.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_remove_2()`](fn@json_remove_2)"]
pub type json_remove_2<J, json, path_1, path_2> =
    json_remove_2_utils::json_remove_2<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <path_2 as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_remove_2_return_type {
    #[doc =
    "Return type of the [`json_remove_2()`](fn@super::json_remove_2) SQL function."]
    pub type json_remove_2<json, path_1, path_2> =
        super::json_remove_2<<json as
        diesel::expression::Expression>::SqlType, json, path_1, path_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_remove_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_remove_2<J, json, path_1, path_2> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) path_2: path_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, path_1, path_2, __Rhs> ::core::ops::Add<__Rhs> for
                json_remove_2<J, json, path_1, path_2> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, path_2, __Rhs> ::core::ops::Sub<__Rhs> for
                json_remove_2<J, json, path_1, path_2> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, path_2, __Rhs> ::core::ops::Mul<__Rhs> for
                json_remove_2<J, json, path_1, path_2> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, path_2, __Rhs> ::core::ops::Div<__Rhs> for
                json_remove_2<J, json, path_1, path_2> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug, path_2: ::core::fmt::Debug>
        ::core::fmt::Debug for json_remove_2<J, json, path_1, path_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "json_remove_2", "json", &self.json, "path_1", &self.path_1,
                "path_2", &self.path_2, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone, path_2: ::core::clone::Clone>
        ::core::clone::Clone for json_remove_2<J, json, path_1, path_2> {
        #[inline]
        fn clone(&self) -> json_remove_2<J, json, path_1, path_2> {
            json_remove_2 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                path_2: ::core::clone::Clone::clone(&self.path_2),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy, path_2: ::core::marker::Copy>
        ::core::marker::Copy for json_remove_2<J, json, path_1, path_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                path_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_remove_2<J, json, path_1, path_2> {
                type QueryId =
                    json_remove_2<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <path_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <path_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <path_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <path_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_remove_2()`](fn@json_remove_2)"]
    pub type HelperType<J, json, path_1, path_2> =
        json_remove_2<J, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <path_2 as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2> Expression for json_remove_2<J, json, path_1, path_2>
        where (json, path_1, path_2): Expression {
        type SqlType = Nullable<Json>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_remove_2<J, json, path_1, path_2> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        path_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_remove_2<J, json, path_1, path_2> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        path_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2, __DieselInternal> FunctionFragment<__DieselInternal>
        for json_remove_2<J, json, path_1, path_2> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        path_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_remove";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2> QueryFragment<crate::sqlite::Sqlite> for
        json_remove_2<J, json, path_1, path_2> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        path_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, path_2>(json, path_1, path_2);
    const _: () =
        {
            use diesel;
            impl<json, path_1, path_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, path_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                path_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<path_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<path_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_remove_2<J, json, path_1, path_2> where
        __Derived<json, path_1, path_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, path_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __json_remove_return_types {
    #[doc(inline)]
    pub use super::__json_remove_0_return_type::*;
    #[doc(inline)]
    pub use super::__json_remove_1_return_type::*;
    #[doc(inline)]
    pub use super::__json_remove_2_return_type::*;
}
#[doc =
" The `jsonb_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by"]
#[doc =
" zero or more path arguments. The `jsonb_remove(X,P,...)` function returns a copy of the X parameter"]
#[doc =
" with all the elements identified by path arguments removed. Paths that select elements not found in X"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_remove_0`, `jsonb_remove_1`, ... `jsonb_remove_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_remove")]
#[doc = " are silently ignored."]
#[doc = ""]
#[doc =
" Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path"]
#[doc = " search for subsequent arguments."]
#[doc = ""]
#[doc =
" If the `jsonb_remove(X)` function is called with no path arguments, then it returns the input X"]
#[doc = " reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `jsonb_remove()` function throws an error if any of the path arguments is not a well-formed path."]
#[doc = ""]
#[doc = " This function returns value in a binary JSONB format."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Jsonb, Text};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc = " let result = diesel::select(jsonb_remove_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'a\', \'b\', \'c\', \'d\'])), result);"]
#[doc = ""]
#[doc = " // Values are removed sequentially from left to right."]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc =
" let result = diesel::select(jsonb_remove_2::<Jsonb, _, _, _>(json, \"$[0]\", \"$[2]\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'b\', \'c\'])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"b\": 20})), result);"]
#[doc = ""]
#[doc = " // Paths that select not existing elements are silently ignored."]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$.c\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"a\": 10, \"b\": 20})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_remove_0<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json>(json: json) -> jsonb_remove_0<J, json> where
    json: diesel::expression::AsExpression<J> {
    jsonb_remove_0_utils::jsonb_remove_0 {
        json: json.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_remove_0()`](fn@jsonb_remove_0)"]
pub type jsonb_remove_0<J, json> =
    jsonb_remove_0_utils::jsonb_remove_0<J,
    <json as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_remove_0_return_type {
    #[doc =
    "Return type of the [`jsonb_remove_0()`](fn@super::jsonb_remove_0) SQL function."]
    pub type jsonb_remove_0<json> =
        super::jsonb_remove_0<<json as
        diesel::expression::Expression>::SqlType, json>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_remove_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_remove_0<J, json> {
        pub(in super) json: json,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_remove_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_remove_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_remove_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_remove_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug> ::core::fmt::Debug
        for jsonb_remove_0<J, json> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "jsonb_remove_0", "json", &self.json, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_remove_0<J, json> {
        #[inline]
        fn clone(&self) -> jsonb_remove_0<J, json> {
            jsonb_remove_0 {
                json: ::core::clone::Clone::clone(&self.json),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_remove_0<J, json> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for jsonb_remove_0<J, json> {
                type QueryId =
                    jsonb_remove_0<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <json as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc = "The return type of [`jsonb_remove_0()`](fn@jsonb_remove_0)"]
    pub type HelperType<J, json> =
        jsonb_remove_0<J, <json as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json>
        Expression for jsonb_remove_0<J, json> where (json): Expression {
        type SqlType = Nullable<Jsonb>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_remove_0<J, json> where
        json: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_remove_0<J, json> where json: AppearsOnTable<__DieselInternal>,
        Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_remove_0<J, json> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_remove";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json>
        QueryFragment<crate::sqlite::Sqlite> for jsonb_remove_0<J, json> where
        json: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json>(json);
    const _: () =
        {
            use diesel;
            impl<json, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json> where
                json: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_remove_0<J, json> where
        __Derived<json>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by"]
#[doc =
" zero or more path arguments. The `jsonb_remove(X,P,...)` function returns a copy of the X parameter"]
#[doc =
" with all the elements identified by path arguments removed. Paths that select elements not found in X"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_remove_0`, `jsonb_remove_1`, ... `jsonb_remove_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_remove")]
#[doc = " are silently ignored."]
#[doc = ""]
#[doc =
" Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path"]
#[doc = " search for subsequent arguments."]
#[doc = ""]
#[doc =
" If the `jsonb_remove(X)` function is called with no path arguments, then it returns the input X"]
#[doc = " reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `jsonb_remove()` function throws an error if any of the path arguments is not a well-formed path."]
#[doc = ""]
#[doc = " This function returns value in a binary JSONB format."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Jsonb, Text};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc = " let result = diesel::select(jsonb_remove_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'a\', \'b\', \'c\', \'d\'])), result);"]
#[doc = ""]
#[doc = " // Values are removed sequentially from left to right."]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc =
" let result = diesel::select(jsonb_remove_2::<Jsonb, _, _, _>(json, \"$[0]\", \"$[2]\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'b\', \'c\'])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"b\": 20})), result);"]
#[doc = ""]
#[doc = " // Paths that select not existing elements are silently ignored."]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$.c\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"a\": 10, \"b\": 20})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_remove_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, path_1>(json: json, path_1: path_1)
    -> jsonb_remove_1<J, json, path_1> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text> {
    jsonb_remove_1_utils::jsonb_remove_1 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_remove_1()`](fn@jsonb_remove_1)"]
pub type jsonb_remove_1<J, json, path_1> =
    jsonb_remove_1_utils::jsonb_remove_1<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_remove_1_return_type {
    #[doc =
    "Return type of the [`jsonb_remove_1()`](fn@super::jsonb_remove_1) SQL function."]
    pub type jsonb_remove_1<json, path_1> =
        super::jsonb_remove_1<<json as
        diesel::expression::Expression>::SqlType, json, path_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_remove_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_remove_1<J, json, path_1> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, path_1, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_remove_1<J, json, path_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_remove_1<J, json, path_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_remove_1<J, json, path_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_remove_1<J, json, path_1> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb_remove_1<J, json, path_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field3_finish(f,
                "jsonb_remove_1", "json", &self.json, "path_1", &self.path_1,
                "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone> ::core::clone::Clone for
        jsonb_remove_1<J, json, path_1> {
        #[inline]
        fn clone(&self) -> jsonb_remove_1<J, json, path_1> {
            jsonb_remove_1 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy> ::core::marker::Copy for
        jsonb_remove_1<J, json, path_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_remove_1<J, json, path_1> {
                type QueryId =
                    jsonb_remove_1<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <json as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <path_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                            ||
                            <path_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_remove_1()`](fn@jsonb_remove_1)"]
    pub type HelperType<J, json, path_1> =
        jsonb_remove_1<J, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1> Expression for jsonb_remove_1<J, json, path_1> where
        (json, path_1): Expression {
        type SqlType = Nullable<Jsonb>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_remove_1<J, json, path_1> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_remove_1<J, json, path_1> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_remove_1<J, json, path_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_remove";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_remove_1<J, json, path_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1>(json, path_1);
    const _: () =
        {
            use diesel;
            impl<json, path_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_remove_1<J, json, path_1> where
        __Derived<json, path_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by"]
#[doc =
" zero or more path arguments. The `jsonb_remove(X,P,...)` function returns a copy of the X parameter"]
#[doc =
" with all the elements identified by path arguments removed. Paths that select elements not found in X"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_remove_0`, `jsonb_remove_1`, ... `jsonb_remove_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_remove")]
#[doc = " are silently ignored."]
#[doc = ""]
#[doc =
" Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path"]
#[doc = " search for subsequent arguments."]
#[doc = ""]
#[doc =
" If the `jsonb_remove(X)` function is called with no path arguments, then it returns the input X"]
#[doc = " reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `jsonb_remove()` function throws an error if any of the path arguments is not a well-formed path."]
#[doc = ""]
#[doc = " This function returns value in a binary JSONB format."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Jsonb, Text};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc = " let result = diesel::select(jsonb_remove_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'a\', \'b\', \'c\', \'d\'])), result);"]
#[doc = ""]
#[doc = " // Values are removed sequentially from left to right."]
#[doc = " let json = json!([\'a\', \'b\', \'c\', \'d\']);"]
#[doc =
" let result = diesel::select(jsonb_remove_2::<Jsonb, _, _, _>(json, \"$[0]\", \"$[2]\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!([\'b\', \'c\'])), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$.a\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"b\": 20})), result);"]
#[doc = ""]
#[doc = " // Paths that select not existing elements are silently ignored."]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$.c\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(Some(json!({\"a\": 10, \"b\": 20})), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 10, \"b\": 20});"]
#[doc =
" let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, \"$\"))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(None, result);"]
#[doc = ""]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_remove_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    SingleValue, json, path_1,
    path_2>(json: json, path_1: path_1, path_2: path_2)
    -> jsonb_remove_2<J, json, path_1, path_2> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    path_2: diesel::expression::AsExpression<Text> {
    jsonb_remove_2_utils::jsonb_remove_2 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        path_2: path_2.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_remove_2()`](fn@jsonb_remove_2)"]
pub type jsonb_remove_2<J, json, path_1, path_2> =
    jsonb_remove_2_utils::jsonb_remove_2<J,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <path_2 as diesel::expression::AsExpression<Text>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_remove_2_return_type {
    #[doc =
    "Return type of the [`jsonb_remove_2()`](fn@super::jsonb_remove_2) SQL function."]
    pub type jsonb_remove_2<json, path_1, path_2> =
        super::jsonb_remove_2<<json as
        diesel::expression::Expression>::SqlType, json, path_1, path_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_remove_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_remove_2<J, json, path_1, path_2> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) path_2: path_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, path_1, path_2, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_remove_2<J, json, path_1, path_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, path_2, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_remove_2<J, json, path_1, path_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, path_2, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_remove_2<J, json, path_1, path_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, path_1, path_2, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_remove_2<J, json, path_1, path_2> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug, path_2: ::core::fmt::Debug>
        ::core::fmt::Debug for jsonb_remove_2<J, json, path_1, path_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "jsonb_remove_2", "json", &self.json, "path_1", &self.path_1,
                "path_2", &self.path_2, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone, path_2: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_remove_2<J, json, path_1, path_2> {
        #[inline]
        fn clone(&self) -> jsonb_remove_2<J, json, path_1, path_2> {
            jsonb_remove_2 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                path_2: ::core::clone::Clone::clone(&self.path_2),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy, path_2: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_remove_2<J, json, path_1, path_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                path_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_remove_2<J, json, path_1, path_2> {
                type QueryId =
                    jsonb_remove_2<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <path_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <path_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <path_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <path_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_remove_2()`](fn@jsonb_remove_2)"]
    pub type HelperType<J, json, path_1, path_2> =
        jsonb_remove_2<J, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <path_2 as AsExpression<Text>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2> Expression for jsonb_remove_2<J, json, path_1, path_2>
        where (json, path_1, path_2): Expression {
        type SqlType = Nullable<Jsonb>;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_remove_2<J, json, path_1, path_2> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        path_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_remove_2<J, json, path_1, path_2> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        path_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2, __DieselInternal> FunctionFragment<__DieselInternal>
        for jsonb_remove_2<J, json, path_1, path_2> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        path_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_remove";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_remove_2<J, json, path_1, path_2> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        path_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, path_2>(json, path_1, path_2);
    const _: () =
        {
            use diesel;
            impl<json, path_1, path_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, path_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                path_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<path_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<path_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue, json,
        path_1, path_2, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_remove_2<J, json, path_1, path_2> where
        __Derived<json, path_1, path_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, path_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __jsonb_remove_return_types {
    #[doc(inline)]
    pub use super::__jsonb_remove_0_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_remove_1_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_remove_2_return_type::*;
}
#[doc =
" The `json_insert(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with the values V inserted at the paths P, but only where nothing already exists at"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_insert_0`, `json_insert_1`, ... `json_insert_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_insert")]
#[doc =
" the path. Paths that already select an element of X are left unchanged."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc = " A path that ends in `[#]` appends the value to an existing array."]
#[doc = ""]
#[doc =
" If the `json_insert(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_insert()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"c\": 3});"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " // A path that already exists is left unchanged."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_insert_2::<Json, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_insert_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_insert_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_insert_0<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, json>(json: json)
    -> json_insert_0<J, json> where
    json: diesel::expression::AsExpression<J> {
    json_insert_0_utils::json_insert_0 {
        json: json.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_insert_0()`](fn@json_insert_0)"]
pub type json_insert_0<J, json> =
    json_insert_0_utils::json_insert_0<J,
    <json as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_insert_0_return_type {
    #[doc =
    "Return type of the [`json_insert_0()`](fn@super::json_insert_0) SQL function."]
    pub type json_insert_0<json> =
        super::json_insert_0<<json as
        diesel::expression::Expression>::SqlType, json>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_insert_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_insert_0<J, json> {
        pub(in super) json: json,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, __Rhs> ::core::ops::Add<__Rhs> for
                json_insert_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Sub<__Rhs> for
                json_insert_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Mul<__Rhs> for
                json_insert_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Div<__Rhs> for
                json_insert_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug> ::core::fmt::Debug
        for json_insert_0<J, json> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_insert_0", "json", &self.json, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone>
        ::core::clone::Clone for json_insert_0<J, json> {
        #[inline]
        fn clone(&self) -> json_insert_0<J, json> {
            json_insert_0 {
                json: ::core::clone::Clone::clone(&self.json),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy>
        ::core::marker::Copy for json_insert_0<J, json> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_insert_0<J, json> {
                type QueryId =
                    json_insert_0<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <json as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc = "The return type of [`json_insert_0()`](fn@json_insert_0)"]
    pub type HelperType<J, json> =
        json_insert_0<J, <json as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json> Expression for
        json_insert_0<J, json> where (json): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_insert_0<J, json>
        where json: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_insert_0<J, json> where
        json: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_insert_0<J, json> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_insert";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json>
        QueryFragment<crate::sqlite::Sqlite> for json_insert_0<J, json> where
        json: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json>(json);
    const _: () =
        {
            use diesel;
            impl<json, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json> where
                json: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_insert_0<J, json> where
        __Derived<json>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_insert(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with the values V inserted at the paths P, but only where nothing already exists at"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_insert_0`, `json_insert_1`, ... `json_insert_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_insert")]
#[doc =
" the path. Paths that already select an element of X are left unchanged."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc = " A path that ends in `[#]` appends the value to an existing array."]
#[doc = ""]
#[doc =
" If the `json_insert(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_insert()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"c\": 3});"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " // A path that already exists is left unchanged."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_insert_2::<Json, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_insert_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_insert_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_insert_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
    value_1>(json: json, path_1: path_1, value_1: value_1)
    -> json_insert_1<J, V1, json, path_1, value_1> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1> {
    json_insert_1_utils::json_insert_1 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_insert_1()`](fn@json_insert_1)"]
pub type json_insert_1<J, V1, json, path_1, value_1> =
    json_insert_1_utils::json_insert_1<J, V1,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_insert_1_return_type {
    #[doc =
    "Return type of the [`json_insert_1()`](fn@super::json_insert_1) SQL function."]
    pub type json_insert_1<json, path_1, value_1> =
        super::json_insert_1<<json as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_insert_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_insert_1<J, V1, json, path_1, value_1> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Add<__Rhs>
                for json_insert_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Sub<__Rhs>
                for json_insert_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Mul<__Rhs>
                for json_insert_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Div<__Rhs>
                for json_insert_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        json: ::core::fmt::Debug, path_1: ::core::fmt::Debug,
        value_1: ::core::fmt::Debug> ::core::fmt::Debug for
        json_insert_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field5_finish(f,
                "json_insert_1", "json", &self.json, "path_1", &self.path_1,
                "value_1", &self.value_1, "J", &self.J, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        json: ::core::clone::Clone, path_1: ::core::clone::Clone,
        value_1: ::core::clone::Clone> ::core::clone::Clone for
        json_insert_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn clone(&self) -> json_insert_1<J, V1, json, path_1, value_1> {
            json_insert_1 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        json: ::core::marker::Copy, path_1: ::core::marker::Copy,
        value_1: ::core::marker::Copy> ::core::marker::Copy for
        json_insert_1<J, V1, json, path_1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_insert_1<J, V1, json, path_1, value_1> {
                type QueryId =
                    json_insert_1<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                        &&
                                        <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                        <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <path_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_insert_1()`](fn@json_insert_1)"]
    pub type HelperType<J, V1, json, path_1, value_1> =
        json_insert_1<J, V1, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1> Expression for json_insert_1<J, V1, json, path_1, value_1>
        where (json, path_1, value_1): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_insert_1<J, V1, json, path_1, value_1> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_insert_1<J, V1, json, path_1, value_1> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_insert_1<J, V1, json, path_1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_insert";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1> QueryFragment<crate::sqlite::Sqlite> for
        json_insert_1<J, V1, json, path_1, value_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1>(json, path_1, value_1);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_insert_1<J, V1, json, path_1, value_1> where
        __Derived<json, path_1, value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_insert(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with the values V inserted at the paths P, but only where nothing already exists at"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_insert_0`, `json_insert_1`, ... `json_insert_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_insert")]
#[doc =
" the path. Paths that already select an element of X are left unchanged."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc = " A path that ends in `[#]` appends the value to an existing array."]
#[doc = ""]
#[doc =
" If the `json_insert(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_insert()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"c\": 3});"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " // A path that already exists is left unchanged."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(json_insert_1::<Json, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_insert_2::<Json, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_insert_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_insert_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_insert_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob, json,
    path_1, value_1, path_2,
    value_2>(json: json, path_1: path_1, value_1: value_1, path_2: path_2,
    value_2: value_2)
    -> json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1>,
    path_2: diesel::expression::AsExpression<Text>,
    value_2: diesel::expression::AsExpression<V2> {
    json_insert_2_utils::json_insert_2 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        path_2: path_2.as_expression(),
        value_2: value_2.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_insert_2()`](fn@json_insert_2)"]
pub type json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> =
    json_insert_2_utils::json_insert_2<J, V1, V2,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <path_2 as diesel::expression::AsExpression<Text>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_insert_2_return_type {
    #[doc =
    "Return type of the [`json_insert_2()`](fn@super::json_insert_2) SQL function."]
    pub type json_insert_2<json, path_1, value_1, path_2, value_2> =
        super::json_insert_2<<json as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1, path_2, value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_insert_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_insert_2<J, V1, V2, json, path_1, value_1, path_2,
        value_2> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) path_2: path_2,
        pub(in super) value_2: value_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Add<__Rhs> for
                json_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Sub<__Rhs> for
                json_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Mul<__Rhs> for
                json_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Div<__Rhs> for
                json_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        V2: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug,
        path_2: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            let names: &'static _ =
                &["json", "path_1", "value_1", "path_2", "value_2", "J", "V1",
                            "V2"];
            let values: &[&dyn ::core::fmt::Debug] =
                &[&self.json, &self.path_1, &self.value_1, &self.path_2,
                            &self.value_2, &self.J, &self.V1, &&self.V2];
            ::core::fmt::Formatter::debug_struct_fields_finish(f,
                "json_insert_2", names, values)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        V2: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone, value_1: ::core::clone::Clone,
        path_2: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn clone(&self)
            ->
                json_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
            json_insert_2 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                path_2: ::core::clone::Clone::clone(&self.path_2),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        V2: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy, value_1: ::core::marker::Copy,
        path_2: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                path_2: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
                type QueryId =
                    json_insert_2<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <path_2 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                    &&
                                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                &&
                                                <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                            &&
                                            <json as
                                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                        <path_1 as
                                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                    <value_1 as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_2 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                ||
                                                <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                            ||
                                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                        ||
                                        <path_1 as
                                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <value_1 as
                                        diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <path_2 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_insert_2()`](fn@json_insert_2)"]
    pub type HelperType<J, V1, V2, json, path_1, value_1, path_2, value_2> =
        json_insert_2<J, V1, V2, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression,
        <path_2 as AsExpression<Text>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2> Expression for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        (json, path_1, value_1, path_2, value_2): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        path_2: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>,
        path_2: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal>,
        path_2: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_insert";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2>
        QueryFragment<crate::sqlite::Sqlite> for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        path_2: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1, path_2,
        value_2>(json, path_1, value_1, path_2, value_2);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, path_2, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1, path_2, value_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                path_2: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<path_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<path_2 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<path_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        json_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        __Derived<json, path_1, value_1, path_2,
        value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1, path_2, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __json_insert_return_types {
    #[doc(inline)]
    pub use super::__json_insert_0_return_type::*;
    #[doc(inline)]
    pub use super::__json_insert_1_return_type::*;
    #[doc(inline)]
    pub use super::__json_insert_2_return_type::*;
}
#[doc =
" The `jsonb_insert(X,P,V,...)` SQL function works just like the [`json_insert()`](json_insert_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_insert_0`, `jsonb_insert_1`, ... `jsonb_insert_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_insert")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"c\": 3});"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " // A path that already exists is left unchanged."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     jsonb_insert_2::<Jsonb, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_insert_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_insert_0<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, json>(json: json)
    -> jsonb_insert_0<J, json> where
    json: diesel::expression::AsExpression<J> {
    jsonb_insert_0_utils::jsonb_insert_0 {
        json: json.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_insert_0()`](fn@jsonb_insert_0)"]
pub type jsonb_insert_0<J, json> =
    jsonb_insert_0_utils::jsonb_insert_0<J,
    <json as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_insert_0_return_type {
    #[doc =
    "Return type of the [`jsonb_insert_0()`](fn@super::jsonb_insert_0) SQL function."]
    pub type jsonb_insert_0<json> =
        super::jsonb_insert_0<<json as
        diesel::expression::Expression>::SqlType, json>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_insert_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_insert_0<J, json> {
        pub(in super) json: json,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_insert_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_insert_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_insert_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_insert_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug> ::core::fmt::Debug
        for jsonb_insert_0<J, json> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "jsonb_insert_0", "json", &self.json, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_insert_0<J, json> {
        #[inline]
        fn clone(&self) -> jsonb_insert_0<J, json> {
            jsonb_insert_0 {
                json: ::core::clone::Clone::clone(&self.json),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_insert_0<J, json> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for jsonb_insert_0<J, json> {
                type QueryId =
                    jsonb_insert_0<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <json as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc = "The return type of [`jsonb_insert_0()`](fn@jsonb_insert_0)"]
    pub type HelperType<J, json> =
        jsonb_insert_0<J, <json as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json> Expression for
        jsonb_insert_0<J, json> where (json): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        SelectableExpression<__DieselInternal> for jsonb_insert_0<J, json>
        where json: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        AppearsOnTable<__DieselInternal> for jsonb_insert_0<J, json> where
        json: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        FunctionFragment<__DieselInternal> for jsonb_insert_0<J, json> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_insert";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json>
        QueryFragment<crate::sqlite::Sqlite> for jsonb_insert_0<J, json> where
        json: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json>(json);
    const _: () =
        {
            use diesel;
            impl<json, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json> where
                json: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        ValidGrouping<__DieselInternal> for jsonb_insert_0<J, json> where
        __Derived<json>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_insert(X,P,V,...)` SQL function works just like the [`json_insert()`](json_insert_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_insert_0`, `jsonb_insert_1`, ... `jsonb_insert_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_insert")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"c\": 3});"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " // A path that already exists is left unchanged."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     jsonb_insert_2::<Jsonb, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_insert_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_insert_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
    value_1>(json: json, path_1: path_1, value_1: value_1)
    -> jsonb_insert_1<J, V1, json, path_1, value_1> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1> {
    jsonb_insert_1_utils::jsonb_insert_1 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_insert_1()`](fn@jsonb_insert_1)"]
pub type jsonb_insert_1<J, V1, json, path_1, value_1> =
    jsonb_insert_1_utils::jsonb_insert_1<J, V1,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_insert_1_return_type {
    #[doc =
    "Return type of the [`jsonb_insert_1()`](fn@super::jsonb_insert_1) SQL function."]
    pub type jsonb_insert_1<json, path_1, value_1> =
        super::jsonb_insert_1<<json as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_insert_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_insert_1<J, V1, json, path_1, value_1> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Add<__Rhs>
                for jsonb_insert_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Sub<__Rhs>
                for jsonb_insert_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Mul<__Rhs>
                for jsonb_insert_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Div<__Rhs>
                for jsonb_insert_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        json: ::core::fmt::Debug, path_1: ::core::fmt::Debug,
        value_1: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb_insert_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field5_finish(f,
                "jsonb_insert_1", "json", &self.json, "path_1", &self.path_1,
                "value_1", &self.value_1, "J", &self.J, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        json: ::core::clone::Clone, path_1: ::core::clone::Clone,
        value_1: ::core::clone::Clone> ::core::clone::Clone for
        jsonb_insert_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn clone(&self) -> jsonb_insert_1<J, V1, json, path_1, value_1> {
            jsonb_insert_1 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        json: ::core::marker::Copy, path_1: ::core::marker::Copy,
        value_1: ::core::marker::Copy> ::core::marker::Copy for
        jsonb_insert_1<J, V1, json, path_1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_insert_1<J, V1, json, path_1, value_1> {
                type QueryId =
                    jsonb_insert_1<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                        &&
                                        <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                        <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <path_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_insert_1()`](fn@jsonb_insert_1)"]
    pub type HelperType<J, V1, json, path_1, value_1> =
        jsonb_insert_1<J, V1, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1> Expression for jsonb_insert_1<J, V1, json, path_1, value_1>
        where (json, path_1, value_1): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_insert_1<J, V1, json, path_1, value_1> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_insert_1<J, V1, json, path_1, value_1> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_insert_1<J, V1, json, path_1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_insert";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_insert_1<J, V1, json, path_1, value_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1>(json, path_1, value_1);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_insert_1<J, V1, json, path_1, value_1> where
        __Derived<json, path_1, value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_insert(X,P,V,...)` SQL function works just like the [`json_insert()`](json_insert_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_insert_0`, `jsonb_insert_1`, ... `jsonb_insert_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_insert")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"c\": 3});"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " // A path that already exists is left unchanged."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Jsonb, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     jsonb_insert_2::<Jsonb, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_insert_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_insert_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_insert_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob, json,
    path_1, value_1, path_2,
    value_2>(json: json, path_1: path_1, value_1: value_1, path_2: path_2,
    value_2: value_2)
    -> jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1>,
    path_2: diesel::expression::AsExpression<Text>,
    value_2: diesel::expression::AsExpression<V2> {
    jsonb_insert_2_utils::jsonb_insert_2 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        path_2: path_2.as_expression(),
        value_2: value_2.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_insert_2()`](fn@jsonb_insert_2)"]
pub type jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> =
    jsonb_insert_2_utils::jsonb_insert_2<J, V1, V2,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <path_2 as diesel::expression::AsExpression<Text>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_insert_2_return_type {
    #[doc =
    "Return type of the [`jsonb_insert_2()`](fn@super::jsonb_insert_2) SQL function."]
    pub type jsonb_insert_2<json, path_1, value_1, path_2, value_2> =
        super::jsonb_insert_2<<json as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1, path_2, value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_insert_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2,
        value_2> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) path_2: path_2,
        pub(in super) value_2: value_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Add<__Rhs> for
                jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Sub<__Rhs> for
                jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Mul<__Rhs> for
                jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Div<__Rhs> for
                jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        V2: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug,
        path_2: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            let names: &'static _ =
                &["json", "path_1", "value_1", "path_2", "value_2", "J", "V1",
                            "V2"];
            let values: &[&dyn ::core::fmt::Debug] =
                &[&self.json, &self.path_1, &self.value_1, &self.path_2,
                            &self.value_2, &self.J, &self.V1, &&self.V2];
            ::core::fmt::Formatter::debug_struct_fields_finish(f,
                "jsonb_insert_2", names, values)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        V2: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone, value_1: ::core::clone::Clone,
        path_2: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn clone(&self)
            ->
                jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
            jsonb_insert_2 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                path_2: ::core::clone::Clone::clone(&self.path_2),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        V2: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy, value_1: ::core::marker::Copy,
        path_2: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                path_2: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
                type QueryId =
                    jsonb_insert_2<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <path_2 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                    &&
                                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                &&
                                                <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                            &&
                                            <json as
                                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                        <path_1 as
                                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                    <value_1 as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_2 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                ||
                                                <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                            ||
                                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                        ||
                                        <path_1 as
                                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <value_1 as
                                        diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <path_2 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_insert_2()`](fn@jsonb_insert_2)"]
    pub type HelperType<J, V1, V2, json, path_1, value_1, path_2, value_2> =
        jsonb_insert_2<J, V1, V2, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression,
        <path_2 as AsExpression<Text>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2> Expression for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where (json, path_1, value_1, path_2, value_2): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        path_2: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>,
        path_2: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal>,
        path_2: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_insert";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2>
        QueryFragment<crate::sqlite::Sqlite> for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        path_2: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1, path_2,
        value_2>(json, path_1, value_1, path_2, value_2);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, path_2, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1, path_2, value_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                path_2: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<path_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<path_2 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<path_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        jsonb_insert_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where
        __Derived<json, path_1, value_1, path_2,
        value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1, path_2, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __jsonb_insert_return_types {
    #[doc(inline)]
    pub use super::__jsonb_insert_0_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_insert_1_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_insert_2_return_type::*;
}
#[doc =
" The `json_replace(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with values V substituted at the paths P, but only where something already exists"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_replace_0`, `json_replace_1`, ... `json_replace_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_replace")]
#[doc =
" at the path. Paths that select elements not found in X are silently ignored."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc =
" If the `json_replace(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_replace()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc =
" let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // A path that does not exist is silently ignored."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_replace_2::<Json, Integer, Text, _, _, _, _, _>(json, \"$.a\", 99, \"$.b\", \"x\"),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": \"x\"}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_replace_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_replace_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.a\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_replace_0<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, json>(json: json)
    -> json_replace_0<J, json> where
    json: diesel::expression::AsExpression<J> {
    json_replace_0_utils::json_replace_0 {
        json: json.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_replace_0()`](fn@json_replace_0)"]
pub type json_replace_0<J, json> =
    json_replace_0_utils::json_replace_0<J,
    <json as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_replace_0_return_type {
    #[doc =
    "Return type of the [`json_replace_0()`](fn@super::json_replace_0) SQL function."]
    pub type json_replace_0<json> =
        super::json_replace_0<<json as
        diesel::expression::Expression>::SqlType, json>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_replace_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_replace_0<J, json> {
        pub(in super) json: json,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, __Rhs> ::core::ops::Add<__Rhs> for
                json_replace_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Sub<__Rhs> for
                json_replace_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Mul<__Rhs> for
                json_replace_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Div<__Rhs> for
                json_replace_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug> ::core::fmt::Debug
        for json_replace_0<J, json> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_replace_0", "json", &self.json, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone>
        ::core::clone::Clone for json_replace_0<J, json> {
        #[inline]
        fn clone(&self) -> json_replace_0<J, json> {
            json_replace_0 {
                json: ::core::clone::Clone::clone(&self.json),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy>
        ::core::marker::Copy for json_replace_0<J, json> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_replace_0<J, json> {
                type QueryId =
                    json_replace_0<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <json as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc = "The return type of [`json_replace_0()`](fn@json_replace_0)"]
    pub type HelperType<J, json> =
        json_replace_0<J, <json as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json> Expression for
        json_replace_0<J, json> where (json): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_replace_0<J, json>
        where json: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_replace_0<J, json> where
        json: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_replace_0<J, json> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_replace";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json>
        QueryFragment<crate::sqlite::Sqlite> for json_replace_0<J, json> where
        json: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json>(json);
    const _: () =
        {
            use diesel;
            impl<json, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json> where
                json: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_replace_0<J, json> where
        __Derived<json>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_replace(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with values V substituted at the paths P, but only where something already exists"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_replace_0`, `json_replace_1`, ... `json_replace_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_replace")]
#[doc =
" at the path. Paths that select elements not found in X are silently ignored."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc =
" If the `json_replace(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_replace()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc =
" let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // A path that does not exist is silently ignored."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_replace_2::<Json, Integer, Text, _, _, _, _, _>(json, \"$.a\", 99, \"$.b\", \"x\"),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": \"x\"}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_replace_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_replace_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.a\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_replace_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
    value_1>(json: json, path_1: path_1, value_1: value_1)
    -> json_replace_1<J, V1, json, path_1, value_1> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1> {
    json_replace_1_utils::json_replace_1 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_replace_1()`](fn@json_replace_1)"]
pub type json_replace_1<J, V1, json, path_1, value_1> =
    json_replace_1_utils::json_replace_1<J, V1,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_replace_1_return_type {
    #[doc =
    "Return type of the [`json_replace_1()`](fn@super::json_replace_1) SQL function."]
    pub type json_replace_1<json, path_1, value_1> =
        super::json_replace_1<<json as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_replace_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_replace_1<J, V1, json, path_1, value_1> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Add<__Rhs>
                for json_replace_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Sub<__Rhs>
                for json_replace_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Mul<__Rhs>
                for json_replace_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Div<__Rhs>
                for json_replace_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        json: ::core::fmt::Debug, path_1: ::core::fmt::Debug,
        value_1: ::core::fmt::Debug> ::core::fmt::Debug for
        json_replace_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field5_finish(f,
                "json_replace_1", "json", &self.json, "path_1", &self.path_1,
                "value_1", &self.value_1, "J", &self.J, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        json: ::core::clone::Clone, path_1: ::core::clone::Clone,
        value_1: ::core::clone::Clone> ::core::clone::Clone for
        json_replace_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn clone(&self) -> json_replace_1<J, V1, json, path_1, value_1> {
            json_replace_1 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        json: ::core::marker::Copy, path_1: ::core::marker::Copy,
        value_1: ::core::marker::Copy> ::core::marker::Copy for
        json_replace_1<J, V1, json, path_1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_replace_1<J, V1, json, path_1, value_1> {
                type QueryId =
                    json_replace_1<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                        &&
                                        <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                        <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <path_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_replace_1()`](fn@json_replace_1)"]
    pub type HelperType<J, V1, json, path_1, value_1> =
        json_replace_1<J, V1, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1> Expression for json_replace_1<J, V1, json, path_1, value_1>
        where (json, path_1, value_1): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_replace_1<J, V1, json, path_1, value_1> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_replace_1<J, V1, json, path_1, value_1> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_replace_1<J, V1, json, path_1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_replace";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1> QueryFragment<crate::sqlite::Sqlite> for
        json_replace_1<J, V1, json, path_1, value_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1>(json, path_1, value_1);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_replace_1<J, V1, json, path_1, value_1> where
        __Derived<json, path_1, value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_replace(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with values V substituted at the paths P, but only where something already exists"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_replace_0`, `json_replace_1`, ... `json_replace_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_replace")]
#[doc =
" at the path. Paths that select elements not found in X are silently ignored."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc =
" If the `json_replace(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_replace()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc =
" let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // A path that does not exist is silently ignored."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_replace_2::<Json, Integer, Text, _, _, _, _, _>(json, \"$.a\", 99, \"$.b\", \"x\"),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": \"x\"}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_replace_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_replace_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.a\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_replace_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob, json,
    path_1, value_1, path_2,
    value_2>(json: json, path_1: path_1, value_1: value_1, path_2: path_2,
    value_2: value_2)
    -> json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1>,
    path_2: diesel::expression::AsExpression<Text>,
    value_2: diesel::expression::AsExpression<V2> {
    json_replace_2_utils::json_replace_2 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        path_2: path_2.as_expression(),
        value_2: value_2.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_replace_2()`](fn@json_replace_2)"]
pub type json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> =
    json_replace_2_utils::json_replace_2<J, V1, V2,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <path_2 as diesel::expression::AsExpression<Text>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_replace_2_return_type {
    #[doc =
    "Return type of the [`json_replace_2()`](fn@super::json_replace_2) SQL function."]
    pub type json_replace_2<json, path_1, value_1, path_2, value_2> =
        super::json_replace_2<<json as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1, path_2, value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_replace_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_replace_2<J, V1, V2, json, path_1, value_1, path_2,
        value_2> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) path_2: path_2,
        pub(in super) value_2: value_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Add<__Rhs> for
                json_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Sub<__Rhs> for
                json_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Mul<__Rhs> for
                json_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Div<__Rhs> for
                json_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        V2: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug,
        path_2: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            let names: &'static _ =
                &["json", "path_1", "value_1", "path_2", "value_2", "J", "V1",
                            "V2"];
            let values: &[&dyn ::core::fmt::Debug] =
                &[&self.json, &self.path_1, &self.value_1, &self.path_2,
                            &self.value_2, &self.J, &self.V1, &&self.V2];
            ::core::fmt::Formatter::debug_struct_fields_finish(f,
                "json_replace_2", names, values)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        V2: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone, value_1: ::core::clone::Clone,
        path_2: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn clone(&self)
            ->
                json_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
            json_replace_2 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                path_2: ::core::clone::Clone::clone(&self.path_2),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        V2: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy, value_1: ::core::marker::Copy,
        path_2: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                path_2: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
                type QueryId =
                    json_replace_2<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <path_2 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                    &&
                                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                &&
                                                <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                            &&
                                            <json as
                                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                        <path_1 as
                                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                    <value_1 as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_2 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                ||
                                                <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                            ||
                                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                        ||
                                        <path_1 as
                                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <value_1 as
                                        diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <path_2 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_replace_2()`](fn@json_replace_2)"]
    pub type HelperType<J, V1, V2, json, path_1, value_1, path_2, value_2> =
        json_replace_2<J, V1, V2, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression,
        <path_2 as AsExpression<Text>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2> Expression for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where (json, path_1, value_1, path_2, value_2): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        path_2: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>,
        path_2: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal>,
        path_2: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_replace";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2>
        QueryFragment<crate::sqlite::Sqlite> for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        path_2: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1, path_2,
        value_2>(json, path_1, value_1, path_2, value_2);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, path_2, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1, path_2, value_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                path_2: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<path_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<path_2 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<path_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        json_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where
        __Derived<json, path_1, value_1, path_2,
        value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1, path_2, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __json_replace_return_types {
    #[doc(inline)]
    pub use super::__json_replace_0_return_type::*;
    #[doc(inline)]
    pub use super::__json_replace_1_return_type::*;
    #[doc(inline)]
    pub use super::__json_replace_2_return_type::*;
}
#[doc =
" The `jsonb_replace(X,P,V,...)` SQL function works just like the [`json_replace()`](json_replace_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_replace_0`, `jsonb_replace_1`, ... `jsonb_replace_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_replace")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // A path that does not exist is silently ignored."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_replace_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.a\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_replace_0<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, json>(json: json)
    -> jsonb_replace_0<J, json> where
    json: diesel::expression::AsExpression<J> {
    jsonb_replace_0_utils::jsonb_replace_0 {
        json: json.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_replace_0()`](fn@jsonb_replace_0)"]
pub type jsonb_replace_0<J, json> =
    jsonb_replace_0_utils::jsonb_replace_0<J,
    <json as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_replace_0_return_type {
    #[doc =
    "Return type of the [`jsonb_replace_0()`](fn@super::jsonb_replace_0) SQL function."]
    pub type jsonb_replace_0<json> =
        super::jsonb_replace_0<<json as
        diesel::expression::Expression>::SqlType, json>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_replace_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_replace_0<J, json> {
        pub(in super) json: json,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_replace_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_replace_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_replace_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_replace_0<J, json> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug> ::core::fmt::Debug
        for jsonb_replace_0<J, json> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "jsonb_replace_0", "json", &self.json, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_replace_0<J, json> {
        #[inline]
        fn clone(&self) -> jsonb_replace_0<J, json> {
            jsonb_replace_0 {
                json: ::core::clone::Clone::clone(&self.json),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_replace_0<J, json> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for jsonb_replace_0<J, json> {
                type QueryId =
                    jsonb_replace_0<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <json as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc = "The return type of [`jsonb_replace_0()`](fn@jsonb_replace_0)"]
    pub type HelperType<J, json> =
        jsonb_replace_0<J, <json as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json> Expression for
        jsonb_replace_0<J, json> where (json): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        SelectableExpression<__DieselInternal> for jsonb_replace_0<J, json>
        where json: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        AppearsOnTable<__DieselInternal> for jsonb_replace_0<J, json> where
        json: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        FunctionFragment<__DieselInternal> for jsonb_replace_0<J, json> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_replace";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json>
        QueryFragment<crate::sqlite::Sqlite> for jsonb_replace_0<J, json>
        where json: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json>(json);
    const _: () =
        {
            use diesel;
            impl<json, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json> where
                json: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        ValidGrouping<__DieselInternal> for jsonb_replace_0<J, json> where
        __Derived<json>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_replace(X,P,V,...)` SQL function works just like the [`json_replace()`](json_replace_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_replace_0`, `jsonb_replace_1`, ... `jsonb_replace_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_replace")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // A path that does not exist is silently ignored."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_replace_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.a\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_replace_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
    value_1>(json: json, path_1: path_1, value_1: value_1)
    -> jsonb_replace_1<J, V1, json, path_1, value_1> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1> {
    jsonb_replace_1_utils::jsonb_replace_1 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_replace_1()`](fn@jsonb_replace_1)"]
pub type jsonb_replace_1<J, V1, json, path_1, value_1> =
    jsonb_replace_1_utils::jsonb_replace_1<J, V1,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_replace_1_return_type {
    #[doc =
    "Return type of the [`jsonb_replace_1()`](fn@super::jsonb_replace_1) SQL function."]
    pub type jsonb_replace_1<json, path_1, value_1> =
        super::jsonb_replace_1<<json as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_replace_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_replace_1<J, V1, json, path_1, value_1> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Add<__Rhs>
                for jsonb_replace_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Sub<__Rhs>
                for jsonb_replace_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Mul<__Rhs>
                for jsonb_replace_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Div<__Rhs>
                for jsonb_replace_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        json: ::core::fmt::Debug, path_1: ::core::fmt::Debug,
        value_1: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb_replace_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field5_finish(f,
                "jsonb_replace_1", "json", &self.json, "path_1", &self.path_1,
                "value_1", &self.value_1, "J", &self.J, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        json: ::core::clone::Clone, path_1: ::core::clone::Clone,
        value_1: ::core::clone::Clone> ::core::clone::Clone for
        jsonb_replace_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn clone(&self) -> jsonb_replace_1<J, V1, json, path_1, value_1> {
            jsonb_replace_1 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        json: ::core::marker::Copy, path_1: ::core::marker::Copy,
        value_1: ::core::marker::Copy> ::core::marker::Copy for
        jsonb_replace_1<J, V1, json, path_1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_replace_1<J, V1, json, path_1, value_1> {
                type QueryId =
                    jsonb_replace_1<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                        &&
                                        <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                        <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <path_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_replace_1()`](fn@jsonb_replace_1)"]
    pub type HelperType<J, V1, json, path_1, value_1> =
        jsonb_replace_1<J, V1, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1> Expression for jsonb_replace_1<J, V1, json, path_1, value_1>
        where (json, path_1, value_1): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_replace_1<J, V1, json, path_1, value_1> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_replace_1<J, V1, json, path_1, value_1> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_replace_1<J, V1, json, path_1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_replace";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_replace_1<J, V1, json, path_1, value_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1>(json, path_1, value_1);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_replace_1<J, V1, json, path_1, value_1> where
        __Derived<json, path_1, value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_replace(X,P,V,...)` SQL function works just like the [`json_replace()`](json_replace_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_replace_0`, `jsonb_replace_1`, ... `jsonb_replace_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_replace")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1, \"b\": 2});"]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // A path that does not exist is silently ignored."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_replace_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_replace_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.a\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_replace_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob, json,
    path_1, value_1, path_2,
    value_2>(json: json, path_1: path_1, value_1: value_1, path_2: path_2,
    value_2: value_2)
    -> jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
    where json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1>,
    path_2: diesel::expression::AsExpression<Text>,
    value_2: diesel::expression::AsExpression<V2> {
    jsonb_replace_2_utils::jsonb_replace_2 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        path_2: path_2.as_expression(),
        value_2: value_2.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_replace_2()`](fn@jsonb_replace_2)"]
pub type jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> =
    jsonb_replace_2_utils::jsonb_replace_2<J, V1, V2,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <path_2 as diesel::expression::AsExpression<Text>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_replace_2_return_type {
    #[doc =
    "Return type of the [`jsonb_replace_2()`](fn@super::jsonb_replace_2) SQL function."]
    pub type jsonb_replace_2<json, path_1, value_1, path_2, value_2> =
        super::jsonb_replace_2<<json as
        diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1, path_2, value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_replace_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2,
        value_2> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) path_2: path_2,
        pub(in super) value_2: value_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Add<__Rhs> for
                jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Sub<__Rhs> for
                jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Mul<__Rhs> for
                jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Div<__Rhs> for
                jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        V2: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug,
        path_2: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            let names: &'static _ =
                &["json", "path_1", "value_1", "path_2", "value_2", "J", "V1",
                            "V2"];
            let values: &[&dyn ::core::fmt::Debug] =
                &[&self.json, &self.path_1, &self.value_1, &self.path_2,
                            &self.value_2, &self.J, &self.V1, &&self.V2];
            ::core::fmt::Formatter::debug_struct_fields_finish(f,
                "jsonb_replace_2", names, values)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        V2: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone, value_1: ::core::clone::Clone,
        path_2: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn clone(&self)
            ->
                jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
            jsonb_replace_2 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                path_2: ::core::clone::Clone::clone(&self.path_2),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        V2: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy, value_1: ::core::marker::Copy,
        path_2: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                path_2: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
                type QueryId =
                    jsonb_replace_2<<J as
                    diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <path_2 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                    &&
                                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                &&
                                                <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                            &&
                                            <json as
                                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                        <path_1 as
                                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                    <value_1 as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_2 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                ||
                                                <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                            ||
                                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                        ||
                                        <path_1 as
                                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <value_1 as
                                        diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <path_2 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_replace_2()`](fn@jsonb_replace_2)"]
    pub type HelperType<J, V1, V2, json, path_1, value_1, path_2, value_2> =
        jsonb_replace_2<J, V1, V2, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression,
        <path_2 as AsExpression<Text>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2> Expression for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where (json, path_1, value_1, path_2, value_2): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        path_2: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>,
        path_2: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal>,
        path_2: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_replace";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2>
        QueryFragment<crate::sqlite::Sqlite> for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        path_2: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1, path_2,
        value_2>(json, path_1, value_1, path_2, value_2);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, path_2, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1, path_2, value_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                path_2: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<path_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<path_2 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<path_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        jsonb_replace_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
        where
        __Derived<json, path_1, value_1, path_2,
        value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1, path_2, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __jsonb_replace_return_types {
    #[doc(inline)]
    pub use super::__jsonb_replace_0_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_replace_1_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_replace_2_return_type::*;
}
#[doc =
" The `json_set(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with values V inserted or replaced at the paths P. Unlike [`json_replace()`](json_replace_1()),"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_set_0`, `json_set_1`, ... `json_set_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_set")]
#[doc =
" `json_set()` also inserts new values where the path does not already exist."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc = " A path that ends in `[#]` appends the value to an existing array."]
#[doc = ""]
#[doc =
" If the `json_set(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_set()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // Existing values are replaced."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_set_2::<Json, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_set_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_set_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_set_0<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, json>(json: json)
    -> json_set_0<J, json> where json: diesel::expression::AsExpression<J> {
    json_set_0_utils::json_set_0 {
        json: json.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_set_0()`](fn@json_set_0)"]
pub type json_set_0<J, json> =
    json_set_0_utils::json_set_0<J,
    <json as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_set_0_return_type {
    #[doc =
    "Return type of the [`json_set_0()`](fn@super::json_set_0) SQL function."]
    pub type json_set_0<json> =
        super::json_set_0<<json as diesel::expression::Expression>::SqlType,
        json>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_set_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_set_0<J, json> {
        pub(in super) json: json,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, __Rhs> ::core::ops::Add<__Rhs> for
                json_set_0<J, json> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Sub<__Rhs> for
                json_set_0<J, json> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Mul<__Rhs> for
                json_set_0<J, json> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Div<__Rhs> for
                json_set_0<J, json> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug> ::core::fmt::Debug
        for json_set_0<J, json> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "json_set_0", "json", &self.json, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone>
        ::core::clone::Clone for json_set_0<J, json> {
        #[inline]
        fn clone(&self) -> json_set_0<J, json> {
            json_set_0 {
                json: ::core::clone::Clone::clone(&self.json),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy>
        ::core::marker::Copy for json_set_0<J, json> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for json_set_0<J, json> {
                type QueryId =
                    json_set_0<<J as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <json as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc = "The return type of [`json_set_0()`](fn@json_set_0)"]
    pub type HelperType<J, json> =
        json_set_0<J, <json as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json> Expression for
        json_set_0<J, json> where (json): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        SelectableExpression<__DieselInternal> for json_set_0<J, json> where
        json: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_set_0<J, json> where
        json: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_set_0<J, json> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_set";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json>
        QueryFragment<crate::sqlite::Sqlite> for json_set_0<J, json> where
        json: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json>(json);
    const _: () =
        {
            use diesel;
            impl<json, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json> where
                json: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, json, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_set_0<J, json> where
        __Derived<json>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_set(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with values V inserted or replaced at the paths P. Unlike [`json_replace()`](json_replace_1()),"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_set_0`, `json_set_1`, ... `json_set_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_set")]
#[doc =
" `json_set()` also inserts new values where the path does not already exist."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc = " A path that ends in `[#]` appends the value to an existing array."]
#[doc = ""]
#[doc =
" If the `json_set(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_set()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // Existing values are replaced."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_set_2::<Json, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_set_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_set_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_set_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
    value_1>(json: json, path_1: path_1, value_1: value_1)
    -> json_set_1<J, V1, json, path_1, value_1> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1> {
    json_set_1_utils::json_set_1 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_set_1()`](fn@json_set_1)"]
pub type json_set_1<J, V1, json, path_1, value_1> =
    json_set_1_utils::json_set_1<J, V1,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_set_1_return_type {
    #[doc =
    "Return type of the [`json_set_1()`](fn@super::json_set_1) SQL function."]
    pub type json_set_1<json, path_1, value_1> =
        super::json_set_1<<json as diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_set_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_set_1<J, V1, json, path_1, value_1> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Add<__Rhs>
                for json_set_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Sub<__Rhs>
                for json_set_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Mul<__Rhs>
                for json_set_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Div<__Rhs>
                for json_set_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        json: ::core::fmt::Debug, path_1: ::core::fmt::Debug,
        value_1: ::core::fmt::Debug> ::core::fmt::Debug for
        json_set_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field5_finish(f,
                "json_set_1", "json", &self.json, "path_1", &self.path_1,
                "value_1", &self.value_1, "J", &self.J, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        json: ::core::clone::Clone, path_1: ::core::clone::Clone,
        value_1: ::core::clone::Clone> ::core::clone::Clone for
        json_set_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn clone(&self) -> json_set_1<J, V1, json, path_1, value_1> {
            json_set_1 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        json: ::core::marker::Copy, path_1: ::core::marker::Copy,
        value_1: ::core::marker::Copy> ::core::marker::Copy for
        json_set_1<J, V1, json, path_1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_set_1<J, V1, json, path_1, value_1> {
                type QueryId =
                    json_set_1<<J as diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                        &&
                                        <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                        <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <path_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_set_1()`](fn@json_set_1)"]
    pub type HelperType<J, V1, json, path_1, value_1> =
        json_set_1<J, V1, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1> Expression for json_set_1<J, V1, json, path_1, value_1> where
        (json, path_1, value_1): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        json_set_1<J, V1, json, path_1, value_1> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        json_set_1<J, V1, json, path_1, value_1> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        json_set_1<J, V1, json, path_1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_set";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1> QueryFragment<crate::sqlite::Sqlite> for
        json_set_1<J, V1, json, path_1, value_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1>(json, path_1, value_1);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        json_set_1<J, V1, json, path_1, value_1> where
        __Derived<json, path_1, value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `json_set(X,P,V,...)` SQL function takes a single JSON value as its first argument"]
#[doc =
" followed by zero or more pairs of path and value arguments. It returns a copy of the X"]
#[doc =
" argument with values V inserted or replaced at the paths P. Unlike [`json_replace()`](json_replace_1()),"]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`json_set_0`, `json_set_1`, ... `json_set_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "json_set")]
#[doc =
" `json_set()` also inserts new values where the path does not already exist."]
#[doc = ""]
#[doc = " The path/value pairs are applied sequentially from left to right."]
#[doc = ""]
#[doc = " A path that ends in `[#]` appends the value to an existing array."]
#[doc = ""]
#[doc =
" If the `json_set(X)` function is called with no path/value pairs, then it returns the"]
#[doc = " input X reformatted, with excess whitespace removed."]
#[doc = ""]
#[doc =
" The `json_set()` function throws an error if any of the path arguments is not a"]
#[doc = " well-formed path."]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Json, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // Existing values are replaced."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(json_set_1::<Json, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select("]
#[doc =
"     json_set_2::<Json, Integer, Integer, _, _, _, _, _>(json, \"$.b\", 2, \"$.c\", 3),"]
#[doc = " )"]
#[doc = " .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2, \"c\": 3}), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(json_set_0::<Json, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(json_set_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_set_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob, json,
    path_1, value_1, path_2,
    value_2>(json: json, path_1: path_1, value_1: value_1, path_2: path_2,
    value_2: value_2)
    -> json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1>,
    path_2: diesel::expression::AsExpression<Text>,
    value_2: diesel::expression::AsExpression<V2> {
    json_set_2_utils::json_set_2 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        path_2: path_2.as_expression(),
        value_2: value_2.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_set_2()`](fn@json_set_2)"]
pub type json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> =
    json_set_2_utils::json_set_2<J, V1, V2,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <path_2 as diesel::expression::AsExpression<Text>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_set_2_return_type {
    #[doc =
    "Return type of the [`json_set_2()`](fn@super::json_set_2) SQL function."]
    pub type json_set_2<json, path_1, value_1, path_2, value_2> =
        super::json_set_2<<json as diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1, path_2, value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_set_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) path_2: path_2,
        pub(in super) value_2: value_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Add<__Rhs> for
                json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Sub<__Rhs> for
                json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Mul<__Rhs> for
                json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Div<__Rhs> for
                json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        V2: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug,
        path_2: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            let names: &'static _ =
                &["json", "path_1", "value_1", "path_2", "value_2", "J", "V1",
                            "V2"];
            let values: &[&dyn ::core::fmt::Debug] =
                &[&self.json, &self.path_1, &self.value_1, &self.path_2,
                            &self.value_2, &self.J, &self.V1, &&self.V2];
            ::core::fmt::Formatter::debug_struct_fields_finish(f,
                "json_set_2", names, values)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        V2: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone, value_1: ::core::clone::Clone,
        path_2: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn clone(&self)
            -> json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
            json_set_2 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                path_2: ::core::clone::Clone::clone(&self.path_2),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        V2: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy, value_1: ::core::marker::Copy,
        path_2: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                path_2: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                {
                type QueryId =
                    json_set_2<<J as diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <path_2 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                    &&
                                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                &&
                                                <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                            &&
                                            <json as
                                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                        <path_1 as
                                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                    <value_1 as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_2 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                ||
                                                <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                            ||
                                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                        ||
                                        <path_1 as
                                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <value_1 as
                                        diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <path_2 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_set_2()`](fn@json_set_2)"]
    pub type HelperType<J, V1, V2, json, path_1, value_1, path_2, value_2> =
        json_set_2<J, V1, V2, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression,
        <path_2 as AsExpression<Text>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2> Expression for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        (json, path_1, value_1, path_2, value_2): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        path_2: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>,
        path_2: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal>,
        path_2: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_set";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2>
        QueryFragment<crate::sqlite::Sqlite> for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        path_2: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1, path_2,
        value_2>(json, path_1, value_1, path_2, value_2);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, path_2, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1, path_2, value_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                path_2: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<path_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<path_2 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<path_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Json> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        json_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        __Derived<json, path_1, value_1, path_2,
        value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1, path_2, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __json_set_return_types {
    #[doc(inline)]
    pub use super::__json_set_0_return_type::*;
    #[doc(inline)]
    pub use super::__json_set_1_return_type::*;
    #[doc(inline)]
    pub use super::__json_set_2_return_type::*;
}
#[doc =
" The `jsonb_set(X,P,V,...)` SQL function works just like the [`json_set()`](json_set_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_set_0`, `jsonb_set_1`, ... `jsonb_set_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_set")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // Existing values are replaced."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_set_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_set_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_set_0<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, json>(json: json)
    -> jsonb_set_0<J, json> where json: diesel::expression::AsExpression<J> {
    jsonb_set_0_utils::jsonb_set_0 {
        json: json.as_expression(),
        J: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_set_0()`](fn@jsonb_set_0)"]
pub type jsonb_set_0<J, json> =
    jsonb_set_0_utils::jsonb_set_0<J,
    <json as diesel::expression::AsExpression<J>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_set_0_return_type {
    #[doc =
    "Return type of the [`jsonb_set_0()`](fn@super::jsonb_set_0) SQL function."]
    pub type jsonb_set_0<json> =
        super::jsonb_set_0<<json as diesel::expression::Expression>::SqlType,
        json>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_set_0_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_set_0<J, json> {
        pub(in super) json: json,
        pub(in super) J: ::core::marker::PhantomData<J>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, json, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_set_0<J, json> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_set_0<J, json> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_set_0<J, json> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, json, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_set_0<J, json> where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, json: ::core::fmt::Debug> ::core::fmt::Debug
        for jsonb_set_0<J, json> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field2_finish(f,
                "jsonb_set_0", "json", &self.json, "J", &&self.J)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, json: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_set_0<J, json> {
        #[inline]
        fn clone(&self) -> jsonb_set_0<J, json> {
            jsonb_set_0 {
                json: ::core::clone::Clone::clone(&self.json),
                J: ::core::clone::Clone::clone(&self.J),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, json: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_set_0<J, json> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for jsonb_set_0<J, json> {
                type QueryId =
                    jsonb_set_0<<J as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                            &&
                            <json as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        || false;
            }
        };
    #[doc = "The return type of [`jsonb_set_0()`](fn@jsonb_set_0)"]
    pub type HelperType<J, json> =
        jsonb_set_0<J, <json as AsExpression<J>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json> Expression for
        jsonb_set_0<J, json> where (json): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        SelectableExpression<__DieselInternal> for jsonb_set_0<J, json> where
        json: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        AppearsOnTable<__DieselInternal> for jsonb_set_0<J, json> where
        json: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        FunctionFragment<__DieselInternal> for jsonb_set_0<J, json> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_set";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json>
        QueryFragment<crate::sqlite::Sqlite> for jsonb_set_0<J, json> where
        json: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json>(json);
    const _: () =
        {
            use diesel;
            impl<json, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json> where
                json: diesel::expression::ValidGrouping<__GroupByClause> {
                type IsAggregate =
                    <json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, json, __DieselInternal>
        ValidGrouping<__DieselInternal> for jsonb_set_0<J, json> where
        __Derived<json>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json> as ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_set(X,P,V,...)` SQL function works just like the [`json_set()`](json_set_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_set_0`, `jsonb_set_1`, ... `jsonb_set_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_set")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // Existing values are replaced."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_set_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_set_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_set_1<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
    value_1>(json: json, path_1: path_1, value_1: value_1)
    -> jsonb_set_1<J, V1, json, path_1, value_1> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1> {
    jsonb_set_1_utils::jsonb_set_1 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_set_1()`](fn@jsonb_set_1)"]
pub type jsonb_set_1<J, V1, json, path_1, value_1> =
    jsonb_set_1_utils::jsonb_set_1<J, V1,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_set_1_return_type {
    #[doc =
    "Return type of the [`jsonb_set_1()`](fn@super::jsonb_set_1) SQL function."]
    pub type jsonb_set_1<json, path_1, value_1> =
        super::jsonb_set_1<<json as diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_set_1_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_set_1<J, V1, json, path_1, value_1> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Add<__Rhs>
                for jsonb_set_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Sub<__Rhs>
                for jsonb_set_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Mul<__Rhs>
                for jsonb_set_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, json, path_1, value_1, __Rhs> ::core::ops::Div<__Rhs>
                for jsonb_set_1<J, V1, json, path_1, value_1> where
                Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        json: ::core::fmt::Debug, path_1: ::core::fmt::Debug,
        value_1: ::core::fmt::Debug> ::core::fmt::Debug for
        jsonb_set_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field5_finish(f,
                "jsonb_set_1", "json", &self.json, "path_1", &self.path_1,
                "value_1", &self.value_1, "J", &self.J, "V1", &&self.V1)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        json: ::core::clone::Clone, path_1: ::core::clone::Clone,
        value_1: ::core::clone::Clone> ::core::clone::Clone for
        jsonb_set_1<J, V1, json, path_1, value_1> {
        #[inline]
        fn clone(&self) -> jsonb_set_1<J, V1, json, path_1, value_1> {
            jsonb_set_1 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        json: ::core::marker::Copy, path_1: ::core::marker::Copy,
        value_1: ::core::marker::Copy> ::core::marker::Copy for
        jsonb_set_1<J, V1, json, path_1, value_1> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_set_1<J, V1, json, path_1, value_1> {
                type QueryId =
                    jsonb_set_1<<J as diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                        &&
                                        <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <json as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_1 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_1 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                        <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                    ||
                                    <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                ||
                                <path_1 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_1 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_set_1()`](fn@jsonb_set_1)"]
    pub type HelperType<J, V1, json, path_1, value_1> =
        jsonb_set_1<J, V1, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1> Expression for jsonb_set_1<J, V1, json, path_1, value_1>
        where (json, path_1, value_1): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> SelectableExpression<__DieselInternal> for
        jsonb_set_1<J, V1, json, path_1, value_1> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> AppearsOnTable<__DieselInternal> for
        jsonb_set_1<J, V1, json, path_1, value_1> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> FunctionFragment<__DieselInternal> for
        jsonb_set_1<J, V1, json, path_1, value_1> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_set";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1> QueryFragment<crate::sqlite::Sqlite> for
        jsonb_set_1<J, V1, json, path_1, value_1> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1>(json, path_1, value_1);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, json, path_1,
        value_1, __DieselInternal> ValidGrouping<__DieselInternal> for
        jsonb_set_1<J, V1, json, path_1, value_1> where
        __Derived<json, path_1, value_1>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" The `jsonb_set(X,P,V,...)` SQL function works just like the [`json_set()`](json_set_1())"]
#[doc =
" function except that the result is returned in SQLite\'s private binary JSONB format rather than"]
#[doc = " in the standard RFC 8259 text format."]
#[doc = r""]
#[doc = r" # Variadic functions"]
#[doc = r""]
#[doc =
r" This function is variadic in SQL, so there's a family of functions"]
#[doc = r" on a diesel side:"]
#[doc = r""]
#[doc = "`jsonb_set_0`, `jsonb_set_1`, ... `jsonb_set_n`"]
#[doc = r""]
#[doc =
r" Here, the postfix number indicates repetitions of variadic arguments."]
#[doc = r" To use this function, the appropriate version with the correct"]
#[doc = r" argument count must be selected."]
#[doc = r""]
#[doc = r" ## Controlling the generation of variadic function variants"]
#[doc = r""]
#[doc =
r" By default, only variants with 0, 1, and 2 repetitions of variadic"]
#[doc = r" arguments are generated. To generate more variants, set the"]
#[doc =
r" `DIESEL_VARIADIC_FUNCTION_ARGS` environment variable to the desired"]
#[doc = r" number of variants."]
#[doc = r""]
#[doc =
r" For a greater convenience this environment variable can also be set"]
#[doc = r" in a `.cargo/config.toml` file as described in the"]
#[doc =
r" [cargo documentation](https://doc.rust-lang.org/cargo/reference/config.html#env)."]
#[doc(alias = "jsonb_set")]
#[doc = ""]
#[doc = " This function requires at least SQLite 3.38 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::*;"]
#[doc = " #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};"]
#[doc = " #     use serde_json::json;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 38, 0);"]
#[doc = " #"]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, \"$.b\", 2))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1, \"b\": 2}), result);"]
#[doc = ""]
#[doc = " // Existing values are replaced."]
#[doc = " let json = json!({\"a\": 1});"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, \"$.a\", 99))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 99}), result);"]
#[doc = ""]
#[doc = " // A path ending in \"[#]\" appends to an array."]
#[doc = " let json = json!([\'a\', \'b\', \'c\']);"]
#[doc =
" let result = diesel::select(jsonb_set_1::<Jsonb, Text, _, _, _>(json, \"$[#]\", \"d\"))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!([\'a\', \'b\', \'c\', \'d\']), result);"]
#[doc = ""]
#[doc = " let json = json!({\"a\": 1});"]
#[doc = " let result = diesel::select(jsonb_set_0::<Jsonb, _>(json))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\": 1}), result);"]
#[doc = ""]
#[doc =
" let result = diesel::select(jsonb_set_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, \"$.b\", 1))"]
#[doc = "     .get_result::<Option<serde_json::Value>>(connection)?;"]
#[doc = " assert_eq!(result, None);"]
#[doc = " #"]
#[doc = " # Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_set_2<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
    MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob, json,
    path_1, value_1, path_2,
    value_2>(json: json, path_1: path_1, value_1: value_1, path_2: path_2,
    value_2: value_2)
    -> jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
    json: diesel::expression::AsExpression<J>,
    path_1: diesel::expression::AsExpression<Text>,
    value_1: diesel::expression::AsExpression<V1>,
    path_2: diesel::expression::AsExpression<Text>,
    value_2: diesel::expression::AsExpression<V2> {
    jsonb_set_2_utils::jsonb_set_2 {
        json: json.as_expression(),
        path_1: path_1.as_expression(),
        value_1: value_1.as_expression(),
        path_2: path_2.as_expression(),
        value_2: value_2.as_expression(),
        J: ::core::marker::PhantomData,
        V1: ::core::marker::PhantomData,
        V2: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_set_2()`](fn@jsonb_set_2)"]
pub type jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> =
    jsonb_set_2_utils::jsonb_set_2<J, V1, V2,
    <json as diesel::expression::AsExpression<J>>::Expression,
    <path_1 as diesel::expression::AsExpression<Text>>::Expression,
    <value_1 as diesel::expression::AsExpression<V1>>::Expression,
    <path_2 as diesel::expression::AsExpression<Text>>::Expression,
    <value_2 as diesel::expression::AsExpression<V2>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_set_2_return_type {
    #[doc =
    "Return type of the [`jsonb_set_2()`](fn@super::jsonb_set_2) SQL function."]
    pub type jsonb_set_2<json, path_1, value_1, path_2, value_2> =
        super::jsonb_set_2<<json as diesel::expression::Expression>::SqlType,
        <value_1 as diesel::expression::Expression>::SqlType,
        <value_2 as diesel::expression::Expression>::SqlType, json, path_1,
        value_1, path_2, value_2>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_set_2_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2,
        value_2> {
        pub(in super) json: json,
        pub(in super) path_1: path_1,
        pub(in super) value_1: value_1,
        pub(in super) path_2: path_2,
        pub(in super) value_2: value_2,
        pub(in super) J: ::core::marker::PhantomData<J>,
        pub(in super) V1: ::core::marker::PhantomData<V1>,
        pub(in super) V2: ::core::marker::PhantomData<V2>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Add<__Rhs> for
                jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Sub<__Rhs> for
                jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Mul<__Rhs> for
                jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<J, V1, V2, json, path_1, value_1, path_2, value_2, __Rhs>
                ::core::ops::Div<__Rhs> for
                jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                where Self: Expression, Self: Expression,
                <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<J: ::core::fmt::Debug, V1: ::core::fmt::Debug,
        V2: ::core::fmt::Debug, json: ::core::fmt::Debug,
        path_1: ::core::fmt::Debug, value_1: ::core::fmt::Debug,
        path_2: ::core::fmt::Debug, value_2: ::core::fmt::Debug>
        ::core::fmt::Debug for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            let names: &'static _ =
                &["json", "path_1", "value_1", "path_2", "value_2", "J", "V1",
                            "V2"];
            let values: &[&dyn ::core::fmt::Debug] =
                &[&self.json, &self.path_1, &self.value_1, &self.path_2,
                            &self.value_2, &self.J, &self.V1, &&self.V2];
            ::core::fmt::Formatter::debug_struct_fields_finish(f,
                "jsonb_set_2", names, values)
        }
    }
    #[automatically_derived]
    impl<J: ::core::clone::Clone, V1: ::core::clone::Clone,
        V2: ::core::clone::Clone, json: ::core::clone::Clone,
        path_1: ::core::clone::Clone, value_1: ::core::clone::Clone,
        path_2: ::core::clone::Clone, value_2: ::core::clone::Clone>
        ::core::clone::Clone for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
        #[inline]
        fn clone(&self)
            ->
                jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2,
                value_2> {
            jsonb_set_2 {
                json: ::core::clone::Clone::clone(&self.json),
                path_1: ::core::clone::Clone::clone(&self.path_1),
                value_1: ::core::clone::Clone::clone(&self.value_1),
                path_2: ::core::clone::Clone::clone(&self.path_2),
                value_2: ::core::clone::Clone::clone(&self.value_2),
                J: ::core::clone::Clone::clone(&self.J),
                V1: ::core::clone::Clone::clone(&self.V1),
                V2: ::core::clone::Clone::clone(&self.V2),
            }
        }
    }
    #[automatically_derived]
    impl<J: ::core::marker::Copy, V1: ::core::marker::Copy,
        V2: ::core::marker::Copy, json: ::core::marker::Copy,
        path_1: ::core::marker::Copy, value_1: ::core::marker::Copy,
        path_2: ::core::marker::Copy, value_2: ::core::marker::Copy>
        ::core::marker::Copy for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<J: diesel::query_builder::QueryId,
                V1: diesel::query_builder::QueryId,
                V2: diesel::query_builder::QueryId,
                json: diesel::query_builder::QueryId,
                path_1: diesel::query_builder::QueryId,
                value_1: diesel::query_builder::QueryId,
                path_2: diesel::query_builder::QueryId,
                value_2: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2>
                {
                type QueryId =
                    jsonb_set_2<<J as diesel::query_builder::QueryId>::QueryId,
                    <V1 as diesel::query_builder::QueryId>::QueryId,
                    <V2 as diesel::query_builder::QueryId>::QueryId,
                    <json as diesel::query_builder::QueryId>::QueryId,
                    <path_1 as diesel::query_builder::QueryId>::QueryId,
                    <value_1 as diesel::query_builder::QueryId>::QueryId,
                    <path_2 as diesel::query_builder::QueryId>::QueryId,
                    <value_2 as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <J as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                    &&
                                                    <V1 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                                &&
                                                <V2 as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                            &&
                                            <json as
                                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                        <path_1 as
                                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                    <value_1 as
                                        diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                                <path_2 as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <value_2 as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <J as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                                    <V1 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                                ||
                                                <V2 as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                            ||
                                            <json as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                                        ||
                                        <path_1 as
                                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <value_1 as
                                        diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <path_2 as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <value_2 as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_set_2()`](fn@jsonb_set_2)"]
    pub type HelperType<J, V1, V2, json, path_1, value_1, path_2, value_2> =
        jsonb_set_2<J, V1, V2, <json as AsExpression<J>>::Expression,
        <path_1 as AsExpression<Text>>::Expression,
        <value_1 as AsExpression<V1>>::Expression,
        <path_2 as AsExpression<Text>>::Expression,
        <value_2 as AsExpression<V2>>::Expression>;
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2> Expression for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        (json, path_1, value_1, path_2, value_2): Expression {
        type SqlType = J::Out;
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: SelectableExpression<__DieselInternal>,
        path_1: SelectableExpression<__DieselInternal>,
        value_1: SelectableExpression<__DieselInternal>,
        path_2: SelectableExpression<__DieselInternal>,
        value_2: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        AppearsOnTable<__DieselInternal> for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: AppearsOnTable<__DieselInternal>,
        path_1: AppearsOnTable<__DieselInternal>,
        value_1: AppearsOnTable<__DieselInternal>,
        path_2: AppearsOnTable<__DieselInternal>,
        value_2: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        __DieselInternal: diesel::backend::Backend,
        json: QueryFragment<__DieselInternal>,
        path_1: QueryFragment<__DieselInternal>,
        value_1: QueryFragment<__DieselInternal>,
        path_2: QueryFragment<__DieselInternal>,
        value_2: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_set";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.json.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.json.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_1.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_1.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.path_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.path_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.value_2.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.value_2.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2>
        QueryFragment<crate::sqlite::Sqlite> for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        json: QueryFragment<crate::sqlite::Sqlite>,
        path_1: QueryFragment<crate::sqlite::Sqlite>,
        value_1: QueryFragment<crate::sqlite::Sqlite>,
        path_2: QueryFragment<crate::sqlite::Sqlite>,
        value_2: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<json, path_1, value_1, path_2,
        value_2>(json, path_1, value_1, path_2, value_2);
    const _: () =
        {
            use diesel;
            impl<json, path_1, value_1, path_2, value_2, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<json, path_1, value_1, path_2, value_2> where
                json: diesel::expression::ValidGrouping<__GroupByClause>,
                path_1: diesel::expression::ValidGrouping<__GroupByClause>,
                value_1: diesel::expression::ValidGrouping<__GroupByClause>,
                path_2: diesel::expression::ValidGrouping<__GroupByClause>,
                value_2: diesel::expression::ValidGrouping<__GroupByClause>,
                <json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<path_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_1
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<path_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>,
                <<<<json as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                as
                diesel::expression::MixedAggregates<<path_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<value_1 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                as
                diesel::expression::MixedAggregates<<path_2 as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output: diesel::expression::MixedAggregates<<value_2
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<<<<json as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<path_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_1 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<path_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
                    as
                    diesel::expression::MixedAggregates<<value_2 as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<J: JsonOrNullableJsonOrJsonbOrNullableJsonb +
        MaybeNullableValue<Jsonb> + SingleValue, V1: NotBlob, V2: NotBlob,
        json, path_1, value_1, path_2, value_2, __DieselInternal>
        ValidGrouping<__DieselInternal> for
        jsonb_set_2<J, V1, V2, json, path_1, value_1, path_2, value_2> where
        __Derived<json, path_1, value_1, path_2,
        value_2>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<json, path_1, value_1, path_2, value_2> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(inline)]
mod __jsonb_set_return_types {
    #[doc(inline)]
    pub use super::__jsonb_set_0_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_set_1_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_set_2_return_type::*;
}
#[doc =
" Applies an RFC 7396 MergePatch `patch` to the input JSON `target` and"]
#[doc = " returns the patched JSON value."]
#[doc = ""]
#[doc =
" MergePatch can add, modify, or delete elements of a JSON object. Arrays are"]
#[doc =
" treated as atomic values: they can only be inserted, replaced, or deleted as a"]
#[doc = " whole, not modified element-wise."]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::json_patch;"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Json, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = ""]
#[doc = " let result = diesel::select(json_patch::<Json, Json, _, _>("]
#[doc = "     json!( {\"a\":1,\"b\":2} ),"]
#[doc = "     json!( {\"c\":3,\"d\":4} ),"]
#[doc = " ))"]
#[doc = " .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\":1,\"b\":2,\"c\":3,\"d\":4}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_patch::<Json, Json, _, _>("]
#[doc = "     json!( {\"a\":[1,2],\"b\":2} ),"]
#[doc = "     json!( {\"a\":9} ),"]
#[doc = " ))"]
#[doc = " .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\":9,\"b\":2}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_patch::<Json, Json, _, _>("]
#[doc = "     json!( {\"a\":[1,2],\"b\":2} ),"]
#[doc = "     json!( {\"a\":null} ),"]
#[doc = " ))"]
#[doc = " .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"b\":2}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_patch::<Json, Json, _, _>("]
#[doc = "     json!( {\"a\":1,\"b\":2} ),"]
#[doc = "     json!( {\"a\":9,\"b\":null,\"c\":8} ),"]
#[doc = " ))"]
#[doc = " .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\":9,\"c\":8}), result);"]
#[doc = ""]
#[doc = " let result = diesel::select(json_patch::<Json, Json, _, _>("]
#[doc = "     json!( {\"a\":{\"x\":1,\"y\":2},\"b\":3} ),"]
#[doc = "     json!( {\"a\":{\"y\":9},\"c\":8} ),"]
#[doc = " ))"]
#[doc = " .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!("]
#[doc = "     json!({\"a\":{\"x\":1,\"y\":9},\"b\":3,\"c\":8}),"]
#[doc = "     result"]
#[doc = " );"]
#[doc = ""]
#[doc = " // Nullable input yields nullable output"]
#[doc =
" let result = diesel::select(json_patch::<Nullable<Json>, Json, _, _>("]
#[doc = "     None::<Value>,"]
#[doc = "     json!({}),"]
#[doc = " ))"]
#[doc = " .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn json_patch<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
    P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
    CombinedNullableValue<T, Json>, target,
    patch>(target: target, patch: patch) -> json_patch<T, P, target, patch>
    where target: diesel::expression::AsExpression<T>,
    patch: diesel::expression::AsExpression<P> {
    json_patch_utils::json_patch {
        target: target.as_expression(),
        patch: patch.as_expression(),
        T: ::core::marker::PhantomData,
        P: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`json_patch()`](fn@json_patch)"]
pub type json_patch<T, P, target, patch> =
    json_patch_utils::json_patch<T, P,
    <target as diesel::expression::AsExpression<T>>::Expression,
    <patch as diesel::expression::AsExpression<P>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __json_patch_return_type {
    #[doc =
    "Return type of the [`json_patch()`](fn@super::json_patch) SQL function."]
    pub type json_patch<target, patch> =
        super::json_patch<<target as diesel::expression::Expression>::SqlType,
        <patch as diesel::expression::Expression>::SqlType, target, patch>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod json_patch_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct json_patch<T, P, target, patch> {
        pub(in super) target: target,
        pub(in super) patch: patch,
        pub(in super) T: ::core::marker::PhantomData<T>,
        pub(in super) P: ::core::marker::PhantomData<P>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<T, P, target, patch, __Rhs> ::core::ops::Add<__Rhs> for
                json_patch<T, P, target, patch> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<T, P, target, patch, __Rhs> ::core::ops::Sub<__Rhs> for
                json_patch<T, P, target, patch> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<T, P, target, patch, __Rhs> ::core::ops::Mul<__Rhs> for
                json_patch<T, P, target, patch> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<T, P, target, patch, __Rhs> ::core::ops::Div<__Rhs> for
                json_patch<T, P, target, patch> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<T: ::core::fmt::Debug, P: ::core::fmt::Debug,
        target: ::core::fmt::Debug, patch: ::core::fmt::Debug>
        ::core::fmt::Debug for json_patch<T, P, target, patch> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "json_patch", "target", &self.target, "patch", &self.patch,
                "T", &self.T, "P", &&self.P)
        }
    }
    #[automatically_derived]
    impl<T: ::core::clone::Clone, P: ::core::clone::Clone,
        target: ::core::clone::Clone, patch: ::core::clone::Clone>
        ::core::clone::Clone for json_patch<T, P, target, patch> {
        #[inline]
        fn clone(&self) -> json_patch<T, P, target, patch> {
            json_patch {
                target: ::core::clone::Clone::clone(&self.target),
                patch: ::core::clone::Clone::clone(&self.patch),
                T: ::core::clone::Clone::clone(&self.T),
                P: ::core::clone::Clone::clone(&self.P),
            }
        }
    }
    #[automatically_derived]
    impl<T: ::core::marker::Copy, P: ::core::marker::Copy,
        target: ::core::marker::Copy, patch: ::core::marker::Copy>
        ::core::marker::Copy for json_patch<T, P, target, patch> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<T: diesel::query_builder::QueryId,
                P: diesel::query_builder::QueryId,
                target: diesel::query_builder::QueryId,
                patch: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                json_patch<T, P, target, patch> {
                type QueryId =
                    json_patch<<T as diesel::query_builder::QueryId>::QueryId,
                    <P as diesel::query_builder::QueryId>::QueryId,
                    <target as diesel::query_builder::QueryId>::QueryId,
                    <patch as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <P as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <target as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <patch as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <P as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <target as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <patch as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`json_patch()`](fn@json_patch)"]
    pub type HelperType<T, P, target, patch> =
        json_patch<T, P, <target as AsExpression<T>>::Expression,
        <patch as AsExpression<P>>::Expression>;
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Json>, target, patch> Expression for
        json_patch<T, P, target, patch> where (target, patch): Expression {
        type SqlType = P::Out;
    }
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Json>, target, patch, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        json_patch<T, P, target, patch> where
        target: SelectableExpression<__DieselInternal>,
        patch: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Json>, target, patch, __DieselInternal>
        AppearsOnTable<__DieselInternal> for json_patch<T, P, target, patch>
        where target: AppearsOnTable<__DieselInternal>,
        patch: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Json>, target, patch, __DieselInternal>
        FunctionFragment<__DieselInternal> for json_patch<T, P, target, patch>
        where __DieselInternal: diesel::backend::Backend,
        target: QueryFragment<__DieselInternal>,
        patch: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "json_patch";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.target.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.target.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.patch.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.patch.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Json>, target, patch>
        QueryFragment<crate::sqlite::Sqlite> for
        json_patch<T, P, target, patch> where
        target: QueryFragment<crate::sqlite::Sqlite>,
        patch: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<target, patch>(target, patch);
    const _: () =
        {
            use diesel;
            impl<target, patch, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<target, patch> where
                target: diesel::expression::ValidGrouping<__GroupByClause>,
                patch: diesel::expression::ValidGrouping<__GroupByClause>,
                <target as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<patch
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<target as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<patch as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Json>, target, patch, __DieselInternal>
        ValidGrouping<__DieselInternal> for json_patch<T, P, target, patch>
        where __Derived<target, patch>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<target, patch> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[doc =
" Applies an RFC 7396 MergePatch `patch` to the input JSON `target` and"]
#[doc = " returns the patched JSON value in SQLite\'s binary JSONB format."]
#[doc = ""]
#[doc =
" See [`json_patch`](json_patch()) for details about the MergePatch semantics."]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc = " # fn main() {"]
#[doc = " #     #[cfg(feature = \"serde_json\")]"]
#[doc = " #     run_test().unwrap();"]
#[doc = " # }"]
#[doc = " #"]
#[doc = " # #[cfg(feature = \"serde_json\")]"]
#[doc = " # fn run_test() -> QueryResult<()> {"]
#[doc = " #     use diesel::dsl::jsonb_patch;"]
#[doc = " #     use serde_json::{json, Value};"]
#[doc = " #     use diesel::sql_types::{Jsonb, Nullable};"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 45, 0);"]
#[doc = ""]
#[doc = " let result = diesel::select(jsonb_patch::<Jsonb, Jsonb, _, _>("]
#[doc = "     json!( {\"a\":1,\"b\":2} ),"]
#[doc = "     json!( {\"c\":3,\"d\":4} ),"]
#[doc = " ))"]
#[doc = " .get_result::<Value>(connection)?;"]
#[doc = " assert_eq!(json!({\"a\":1,\"b\":2,\"c\":3,\"d\":4}), result);"]
#[doc = ""]
#[doc = " // Nullable input yields nullable output"]
#[doc =
" let result = diesel::select(jsonb_patch::<Nullable<Jsonb>, Jsonb, _, _>("]
#[doc = "     None::<Value>,"]
#[doc = "     json!({}),"]
#[doc = " ))"]
#[doc = " .get_result::<Option<Value>>(connection)?;"]
#[doc = " assert!(result.is_none());"]
#[doc = ""]
#[doc = " #     Ok(())"]
#[doc = " # }"]
#[doc = " ```"]
#[allow(non_camel_case_types)]
pub fn jsonb_patch<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
    P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
    CombinedNullableValue<T, Jsonb>, target,
    patch>(target: target, patch: patch) -> jsonb_patch<T, P, target, patch>
    where target: diesel::expression::AsExpression<T>,
    patch: diesel::expression::AsExpression<P> {
    jsonb_patch_utils::jsonb_patch {
        target: target.as_expression(),
        patch: patch.as_expression(),
        T: ::core::marker::PhantomData,
        P: ::core::marker::PhantomData,
    }
}
#[allow(non_camel_case_types, non_snake_case)]
#[doc = "The return type of [`jsonb_patch()`](fn@jsonb_patch)"]
pub type jsonb_patch<T, P, target, patch> =
    jsonb_patch_utils::jsonb_patch<T, P,
    <target as diesel::expression::AsExpression<T>>::Expression,
    <patch as diesel::expression::AsExpression<P>>::Expression>;
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
#[doc(inline)]
mod __jsonb_patch_return_type {
    #[doc =
    "Return type of the [`jsonb_patch()`](fn@super::jsonb_patch) SQL function."]
    pub type jsonb_patch<target, patch> =
        super::jsonb_patch<<target as
        diesel::expression::Expression>::SqlType,
        <patch as diesel::expression::Expression>::SqlType, target, patch>;
}
#[doc(hidden)]
#[allow(non_camel_case_types, non_snake_case, unused_imports)]
pub(crate) mod jsonb_patch_utils {
    use diesel::{self, QueryResult};
    use diesel::expression::{
        AsExpression, Expression, SelectableExpression, AppearsOnTable,
        ValidGrouping,
    };
    use diesel::query_builder::{QueryFragment, AstPass};
    use diesel::sql_types::*;
    use diesel::internal::sql_functions::*;
    use super::*;
    pub struct jsonb_patch<T, P, target, patch> {
        pub(in super) target: target,
        pub(in super) patch: patch,
        pub(in super) T: ::core::marker::PhantomData<T>,
        pub(in super) P: ::core::marker::PhantomData<P>,
    }
    const _: () =
        {
            use diesel;
            use diesel::internal::derives::numeric_ops as ops;
            use diesel::expression::{Expression, AsExpression};
            use diesel::sql_types::ops::{Add, Sub, Mul, Div};
            use diesel::sql_types::{SqlType, SingleValue};
            impl<T, P, target, patch, __Rhs> ::core::ops::Add<__Rhs> for
                jsonb_patch<T, P, target, patch> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Add,
                <<Self as Expression>::SqlType as Add>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Add>::Rhs> {
                type Output = ops::Add<Self, __Rhs::Expression>;
                fn add(self, rhs: __Rhs) -> Self::Output {
                    ops::Add::new(self, rhs.as_expression())
                }
            }
            impl<T, P, target, patch, __Rhs> ::core::ops::Sub<__Rhs> for
                jsonb_patch<T, P, target, patch> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Sub,
                <<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Sub>::Rhs> {
                type Output = ops::Sub<Self, __Rhs::Expression>;
                fn sub(self, rhs: __Rhs) -> Self::Output {
                    ops::Sub::new(self, rhs.as_expression())
                }
            }
            impl<T, P, target, patch, __Rhs> ::core::ops::Mul<__Rhs> for
                jsonb_patch<T, P, target, patch> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Mul,
                <<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Mul>::Rhs> {
                type Output = ops::Mul<Self, __Rhs::Expression>;
                fn mul(self, rhs: __Rhs) -> Self::Output {
                    ops::Mul::new(self, rhs.as_expression())
                }
            }
            impl<T, P, target, patch, __Rhs> ::core::ops::Div<__Rhs> for
                jsonb_patch<T, P, target, patch> where Self: Expression,
                Self: Expression, <Self as Expression>::SqlType: Div,
                <<Self as Expression>::SqlType as Div>::Rhs: SqlType +
                SingleValue,
                __Rhs: AsExpression<<<Self as Expression>::SqlType as
                Div>::Rhs> {
                type Output = ops::Div<Self, __Rhs::Expression>;
                fn div(self, rhs: __Rhs) -> Self::Output {
                    ops::Div::new(self, rhs.as_expression())
                }
            }
        };
    #[automatically_derived]
    impl<T: ::core::fmt::Debug, P: ::core::fmt::Debug,
        target: ::core::fmt::Debug, patch: ::core::fmt::Debug>
        ::core::fmt::Debug for jsonb_patch<T, P, target, patch> {
        #[inline]
        fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
            ::core::fmt::Formatter::debug_struct_field4_finish(f,
                "jsonb_patch", "target", &self.target, "patch", &self.patch,
                "T", &self.T, "P", &&self.P)
        }
    }
    #[automatically_derived]
    impl<T: ::core::clone::Clone, P: ::core::clone::Clone,
        target: ::core::clone::Clone, patch: ::core::clone::Clone>
        ::core::clone::Clone for jsonb_patch<T, P, target, patch> {
        #[inline]
        fn clone(&self) -> jsonb_patch<T, P, target, patch> {
            jsonb_patch {
                target: ::core::clone::Clone::clone(&self.target),
                patch: ::core::clone::Clone::clone(&self.patch),
                T: ::core::clone::Clone::clone(&self.T),
                P: ::core::clone::Clone::clone(&self.P),
            }
        }
    }
    #[automatically_derived]
    impl<T: ::core::marker::Copy, P: ::core::marker::Copy,
        target: ::core::marker::Copy, patch: ::core::marker::Copy>
        ::core::marker::Copy for jsonb_patch<T, P, target, patch> {
    }
    const _: () =
        {
            use diesel;
            #[allow(non_camel_case_types)]
            impl<T: diesel::query_builder::QueryId,
                P: diesel::query_builder::QueryId,
                target: diesel::query_builder::QueryId,
                patch: diesel::query_builder::QueryId>
                diesel::query_builder::QueryId for
                jsonb_patch<T, P, target, patch> {
                type QueryId =
                    jsonb_patch<<T as diesel::query_builder::QueryId>::QueryId,
                    <P as diesel::query_builder::QueryId>::QueryId,
                    <target as diesel::query_builder::QueryId>::QueryId,
                    <patch as diesel::query_builder::QueryId>::QueryId>;
                const HAS_STATIC_QUERY_ID: bool =
                    <T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                    &&
                                    <P as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                                &&
                                <target as
                                    diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                            <patch as
                                diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                        true;
                const IS_WINDOW_FUNCTION: bool =
                    <T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                    <P as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                                <target as
                                    diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                            <patch as
                                diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                        false;
            }
        };
    #[doc = "The return type of [`jsonb_patch()`](fn@jsonb_patch)"]
    pub type HelperType<T, P, target, patch> =
        jsonb_patch<T, P, <target as AsExpression<T>>::Expression,
        <patch as AsExpression<P>>::Expression>;
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Jsonb>, target, patch> Expression for
        jsonb_patch<T, P, target, patch> where (target, patch): Expression {
        type SqlType = P::Out;
    }
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Jsonb>, target, patch, __DieselInternal>
        SelectableExpression<__DieselInternal> for
        jsonb_patch<T, P, target, patch> where
        target: SelectableExpression<__DieselInternal>,
        patch: SelectableExpression<__DieselInternal>,
        Self: AppearsOnTable<__DieselInternal> {}
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Jsonb>, target, patch, __DieselInternal>
        AppearsOnTable<__DieselInternal> for jsonb_patch<T, P, target, patch>
        where target: AppearsOnTable<__DieselInternal>,
        patch: AppearsOnTable<__DieselInternal>, Self: Expression {}
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Jsonb>, target, patch, __DieselInternal>
        FunctionFragment<__DieselInternal> for
        jsonb_patch<T, P, target, patch> where
        __DieselInternal: diesel::backend::Backend,
        target: QueryFragment<__DieselInternal>,
        patch: QueryFragment<__DieselInternal> {
        const FUNCTION_NAME: &'static str = "jsonb_patch";
        #[allow(unused_assignments)]
        fn walk_arguments<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, __DieselInternal>) -> QueryResult<()> {
            let mut needs_comma = false;
            if !self.target.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.target.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            if !self.patch.is_noop(out.backend())? {
                if needs_comma { out.push_sql(", "); }
                self.patch.walk_ast(out.reborrow())?;
                needs_comma = true;
            }
            Ok(())
        }
    }
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Jsonb>, target, patch>
        QueryFragment<crate::sqlite::Sqlite> for
        jsonb_patch<T, P, target, patch> where
        target: QueryFragment<crate::sqlite::Sqlite>,
        patch: QueryFragment<crate::sqlite::Sqlite> {
        fn walk_ast<'__b>(&'__b self,
            mut out: AstPass<'_, '__b, crate::sqlite::Sqlite>)
            -> QueryResult<()> {
            out.push_sql(<Self as
                    FunctionFragment<crate::sqlite::Sqlite>>::FUNCTION_NAME);
            out.push_sql("(");
            self.walk_arguments(out.reborrow())?;
            out.push_sql(")");
            Ok(())
        }
    }
    pub struct __Derived<target, patch>(target, patch);
    const _: () =
        {
            use diesel;
            impl<target, patch, __GroupByClause>
                diesel::expression::ValidGrouping<__GroupByClause> for
                __Derived<target, patch> where
                target: diesel::expression::ValidGrouping<__GroupByClause>,
                patch: diesel::expression::ValidGrouping<__GroupByClause>,
                <target as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<patch
                as
                diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
                {
                type IsAggregate =
                    <<target as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
                    as
                    diesel::expression::MixedAggregates<<patch as
                    diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
            }
        };
    impl<T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue +
        CombinedNullableValue<T, Jsonb>, target, patch, __DieselInternal>
        ValidGrouping<__DieselInternal> for jsonb_patch<T, P, target, patch>
        where __Derived<target, patch>: ValidGrouping<__DieselInternal> {
        type IsAggregate =
            <__Derived<target, patch> as
            ValidGrouping<__DieselInternal>>::IsAggregate;
    }
}
#[allow(unused_imports)]
#[doc(hidden)]
mod return_type_helpers {
    #[doc(inline)]
    pub use super::__json_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_return_type::*;
    #[doc(inline)]
    pub use super::__json_array_length_return_type::*;
    #[doc(inline)]
    pub use super::__json_array_length_with_path_return_type::*;
    #[doc(inline)]
    pub use super::__json_error_position_return_type::*;
    #[doc(inline)]
    pub use super::__json_extract_string_return_type::*;
    #[doc(inline)]
    pub use super::__json_extract_integer_return_type::*;
    #[doc(inline)]
    pub use super::__json_extract_double_return_type::*;
    #[doc(inline)]
    pub use super::__json_extract_json_return_types::*;
    #[doc(inline)]
    pub use super::__jsonb_extract_string_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_extract_integer_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_extract_double_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_extract_jsonb_return_types::*;
    #[doc(inline)]
    pub use super::__json_pretty_return_type::*;
    #[doc(inline)]
    pub use super::__json_pretty_with_indentation_return_type::*;
    #[doc(inline)]
    pub use super::__json_valid_return_type::*;
    #[doc(inline)]
    pub use super::__json_valid_with_flags_return_type::*;
    #[doc(inline)]
    pub use super::__json_type_return_type::*;
    #[doc(inline)]
    pub use super::__json_type_with_path_return_type::*;
    #[doc(inline)]
    pub use super::__json_quote_return_type::*;
    #[doc(inline)]
    pub use super::__json_group_array_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_group_array_return_type::*;
    #[doc(inline)]
    pub use super::__json_object_return_types::*;
    #[doc(inline)]
    pub use super::__jsonb_object_return_types::*;
    #[doc(inline)]
    pub use super::__json_group_object_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_group_object_return_type::*;
    #[doc(inline)]
    pub use super::__json_array_return_types::*;
    #[doc(inline)]
    pub use super::__jsonb_array_return_types::*;
    #[doc(inline)]
    pub use super::__json_remove_return_types::*;
    #[doc(inline)]
    pub use super::__jsonb_remove_return_types::*;
    #[doc(inline)]
    pub use super::__json_insert_return_types::*;
    #[doc(inline)]
    pub use super::__jsonb_insert_return_types::*;
    #[doc(inline)]
    pub use super::__json_replace_return_types::*;
    #[doc(inline)]
    pub use super::__jsonb_replace_return_types::*;
    #[doc(inline)]
    pub use super::__json_set_return_types::*;
    #[doc(inline)]
    pub use super::__jsonb_set_return_types::*;
    #[doc(inline)]
    pub use super::__json_patch_return_type::*;
    #[doc(inline)]
    pub use super::__jsonb_patch_return_type::*;
}#[declare_sql_function(generate_return_type_helpers = true)]
17#[backends(crate::sqlite::Sqlite)]
18extern "SQL" {
19    /// Verifies that its argument is a valid JSON string or JSONB blob and returns a minified
20    /// version of that JSON string with all unnecessary whitespace removed.
21    ///
22    /// # Example
23    ///
24    /// ```rust
25    /// # include!("../../doctest_setup.rs");
26    /// #
27    /// # fn main() {
28    /// #     #[cfg(feature = "serde_json")]
29    /// #     run_test().unwrap();
30    /// # }
31    /// #
32    /// # #[cfg(feature = "serde_json")]
33    /// # fn run_test() -> QueryResult<()> {
34    /// #     use diesel::dsl::json;
35    /// #     use serde_json::{json, Value};
36    /// #     use diesel::sql_types::{Text, Nullable};
37    /// #     let connection = &mut establish_connection();
38    ///
39    /// let result = diesel::select(json::<Text, _>(r#"{"a": "b", "c": 1}"#))
40    ///     .get_result::<Value>(connection)?;
41    ///
42    /// assert_eq!(json!({"a":"b","c":1}), result);
43    ///
44    /// let result = diesel::select(json::<Text, _>(r#"{ "this" : "is", "a": [ "test" ] }"#))
45    ///     .get_result::<Value>(connection)?;
46    ///
47    /// assert_eq!(json!({"a":["test"],"this":"is"}), result);
48    ///
49    /// let result = diesel::select(json::<Nullable<Text>, _>(None::<&str>))
50    ///     .get_result::<Option<Value>>(connection)?;
51    ///
52    /// assert!(result.is_none());
53    ///
54    /// #     Ok(())
55    /// # }
56    /// ```
57    fn json<E: TextOrNullableText + MaybeNullableValue<Json>>(e: E) -> E::Out;
58
59    /// The jsonb(X) function returns the binary JSONB representation of the JSON provided as argument X.
60    ///
61    /// This function requires at least SQLite 3.45 or newer
62    ///
63    /// # Example
64    ///
65    /// ```rust
66    /// # include!("../../doctest_setup.rs");
67    /// #
68    /// # fn main() {
69    /// #     #[cfg(feature = "serde_json")]
70    /// #     run_test().unwrap();
71    /// # }
72    /// #
73    /// # #[cfg(feature = "serde_json")]
74    /// # fn run_test() -> QueryResult<()> {
75    /// #     use diesel::dsl::{sql, jsonb};
76    /// #     use serde_json::{json, Value};
77    /// #     use diesel::sql_types::{Text, Binary, Nullable};
78    /// #     let connection = &mut establish_connection();
79    /// #     assert_version!(connection, 3, 45, 0);
80    ///
81    /// let result = diesel::select(jsonb::<Binary, _>(br#"{"a": "b", "c": 1}"#))
82    ///     .get_result::<Value>(connection)?;
83    ///
84    /// assert_eq!(json!({"a": "b", "c": 1}), result);
85    ///
86    /// let result = diesel::select(jsonb::<Binary, _>(br#"{"this":"is","a":["test"]}"#))
87    ///     .get_result::<Value>(connection)?;
88    ///
89    /// assert_eq!(json!({"this":"is","a":["test"]}), result);
90    ///
91    /// let result = diesel::select(jsonb::<Nullable<Binary>, _>(None::<Vec<u8>>))
92    ///     .get_result::<Option<Value>>(connection)?;
93    ///
94    /// assert!(result.is_none());
95    ///
96    /// #     Ok(())
97    /// # }
98    /// ```
99    fn jsonb<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>>(e: E) -> E::Out;
100
101    /// The json_array_length(X) function returns the number of elements in the JSON array X,
102    /// or 0 if X is some kind of JSON value other than an array.
103    /// Errors are thrown if either X is not well-formed JSON or if P is not a well-formed path.
104    ///
105    /// This function requires at least SQLite 3.46 or newer
106    ///
107    /// # Example
108    ///
109    /// ```rust
110    /// # include!("../../doctest_setup.rs");
111    /// #
112    /// # fn main() {
113    /// #     #[cfg(feature = "serde_json")]
114    /// #     run_test().unwrap();
115    /// # }
116    /// #
117    /// # #[cfg(feature = "serde_json")]
118    /// # fn run_test() -> QueryResult<()> {
119    /// #     use diesel::dsl::{sql, json_array_length};
120    /// #     use serde_json::{json, Value};
121    /// #     use diesel::sql_types::{Json, Jsonb, Text, Nullable};
122    /// #     let connection = &mut establish_connection();
123    /// #     assert_version!(connection, 3, 46, 0);
124    ///
125    /// let result = diesel::select(json_array_length::<Json, _>(json!([1,2,3,4])))
126    ///     .get_result::<i32>(connection)?;
127    ///
128    /// assert_eq!(4, result);
129    ///
130    /// let result = diesel::select(json_array_length::<Json, _>(json!({"one":[1,2,3]})))
131    ///     .get_result::<i32>(connection)?;
132    ///
133    /// assert_eq!(0, result);
134    ///
135    /// let result = diesel::select(json_array_length::<Nullable<Json>, _>(None::<Value>))
136    ///     .get_result::<Option<i32>>(connection)?;
137    ///
138    /// assert_eq!(None, result);
139    ///
140    /// let result = diesel::select(json_array_length::<Jsonb, _>(json!([1,2,3,4])))
141    ///     .get_result::<i32>(connection)?;
142    ///
143    /// assert_eq!(4, result);
144    ///
145    /// let result = diesel::select(json_array_length::<Jsonb, _>(json!({"one":[1,2,3]})))
146    ///     .get_result::<i32>(connection)?;
147    ///
148    /// assert_eq!(0, result);
149    ///
150    /// let result = diesel::select(json_array_length::<Nullable<Jsonb>, _>(None::<Value>))
151    ///     .get_result::<Option<i32>>(connection)?;
152    ///
153    /// assert_eq!(None, result);
154    ///
155    /// #     Ok(())
156    /// # }
157    /// ```
158    #[cfg(feature = "__sqlite-shared")]
159    fn json_array_length<
160        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Integer>,
161    >(
162        j: J,
163    ) -> J::Out;
164
165    /// The json_array_length(X) function returns the number of elements in the JSON array X,
166    /// or 0 if X is some kind of JSON value other than an array.
167    /// The json_array_length(X,P) locates the array at path P within X and returns the length of that array,
168    /// or 0 if path P locates an element in X that is not a JSON array,
169    /// and NULL if path P does not locate any element of X.
170    /// Errors are thrown if either X is not well-formed JSON or if P is not a well-formed path.
171    ///
172    /// This function requires at least SQLite 3.46 or newer
173    ///
174    /// # Example
175    ///
176    /// ```rust
177    /// # include!("../../doctest_setup.rs");
178    /// #
179    /// # fn main() {
180    /// #     #[cfg(feature = "serde_json")]
181    /// #     run_test().unwrap();
182    /// # }
183    /// #
184    /// # #[cfg(feature = "serde_json")]
185    /// # fn run_test() -> QueryResult<()> {
186    /// #     use diesel::dsl::{sql, json_array_length_with_path};
187    /// #     use serde_json::{json, Value};
188    /// #     use diesel::sql_types::{Json, Jsonb, Text, Nullable};
189    /// #     let connection = &mut establish_connection();
190    /// #     assert_version!(connection, 3, 46, 0);
191    ///
192    /// let result = diesel::select(json_array_length_with_path::<Json, _, _>(json!([1,2,3,4]), "$"))
193    ///     .get_result::<Option<i32>>(connection)?;
194    ///
195    /// assert_eq!(Some(4), result);
196    ///
197    /// let result = diesel::select(json_array_length_with_path::<Json, _, _>(json!([1,2,3,4]), "$[2]"))
198    ///     .get_result::<Option<i32>>(connection)?;
199    ///
200    /// assert_eq!(Some(0), result);
201    ///
202    /// let result = diesel::select(json_array_length_with_path::<Json, _, _>(json!({"one":[1,2,3]}), "$.one"))
203    ///     .get_result::<Option<i32>>(connection)?;
204    ///
205    /// assert_eq!(Some(3), result);
206    ///
207    /// let result = diesel::select(json_array_length_with_path::<Nullable<Json>, _, _>(json!({"one":[1,2,3]}), "$.two"))
208    ///     .get_result::<Option<i32>>(connection)?;
209    ///
210    /// assert_eq!(None, result);
211    ///
212    /// let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!([1,2,3,4]), "$"))
213    ///     .get_result::<Option<i32>>(connection)?;
214    ///
215    /// assert_eq!(Some(4), result);
216    ///
217    /// let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!([1,2,3,4]), "$[2]"))
218    ///     .get_result::<Option<i32>>(connection)?;
219    ///
220    /// assert_eq!(Some(0), result);
221    ///
222    /// let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!({"one":[1,2,3]}), "$.one"))
223    ///     .get_result::<Option<i32>>(connection)?;
224    ///
225    /// assert_eq!(Some(3), result);
226    ///
227    /// let result = diesel::select(json_array_length_with_path::<Nullable<Jsonb>, _, _>(json!({"one":[1,2,3]}), "$.two"))
228    ///     .get_result::<Option<i32>>(connection)?;
229    ///
230    /// assert_eq!(None, result);
231    ///
232    /// #     Ok(())
233    /// # }
234    /// ```
235    #[sql_name = "json_array_length"]
236    #[cfg(feature = "__sqlite-shared")]
237    fn json_array_length_with_path<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
238        j: J,
239        path: Text,
240    ) -> Nullable<Integer>;
241
242    /// The json_error_position(X) function returns 0 if the input X is a well-formed JSON or JSON5 string.
243    /// If the input X contains one or more syntax errors, then this function returns the character position of the first syntax error.
244    /// The left-most character is position 1.
245    ///
246    /// If the input X is a BLOB, then this routine returns 0 if X is a well-formed JSONB blob. If the return value is positive,
247    /// then it represents the approximate 1-based position in the BLOB of the first detected error.
248    ///
249    /// This function requires at least SQLite 3.46 or newer
250    ///
251    /// # Example
252    ///
253    /// ```rust
254    /// # include!("../../doctest_setup.rs");
255    /// #
256    /// # fn main() {
257    /// #     #[cfg(feature = "serde_json")]
258    /// #     run_test().unwrap();
259    /// # }
260    /// #
261    /// # #[cfg(feature = "serde_json")]
262    /// # fn run_test() -> QueryResult<()> {
263    /// #     use diesel::dsl::{sql, json_error_position};
264    /// #     use diesel::sql_types::{Binary, Text, Nullable};
265    /// #     let connection = &mut establish_connection();
266    /// #     assert_version!(connection, 3, 46, 0);
267    ///
268    /// let result = diesel::select(json_error_position::<Text, _>(r#"{"a": "b", "c": 1}"#))
269    ///     .get_result::<i32>(connection)?;
270    ///
271    /// assert_eq!(0, result);
272    ///
273    /// let result = diesel::select(json_error_position::<Text, _>(r#"{"a": b", "c": 1}"#))
274    ///     .get_result::<i32>(connection)?;
275    ///
276    /// assert_eq!(7, result);
277    ///
278    /// let json5 = r#"
279    ///     {
280    ///         // A traditional message.
281    ///         message: 'hello world',
282    ///
283    ///         // A number for some reason.
284    ///         n: 42,
285    ///     }
286    /// "#;
287    /// let result =
288    ///     diesel::select(json_error_position::<Text, _>(json5)).get_result::<i32>(connection)?;
289    ///
290    /// assert_eq!(0, result);
291    ///
292    /// let json5_with_error = r#"
293    ///     {
294    ///         // A traditional message.
295    ///         message: hello world',
296    ///
297    ///         // A number for some reason.
298    ///         n: 42,
299    ///     }
300    /// "#;
301    /// let result = diesel::select(json_error_position::<Text, _>(json5_with_error))
302    ///     .get_result::<i32>(connection)?;
303    ///
304    /// assert_eq!(59, result);
305    ///
306    /// let result = diesel::select(json_error_position::<Nullable<Text>, _>(None::<&str>))
307    ///     .get_result::<Option<i32>>(connection)?;
308    ///
309    /// assert_eq!(None, result);
310    ///
311    /// let result = diesel::select(json_error_position::<Binary, _>(br#"{"a": "b", "c": 1}"#))
312    ///     .get_result::<i32>(connection)?;
313    ///
314    /// assert_eq!(0, result);
315    ///
316    /// let result = diesel::select(json_error_position::<Binary, _>(br#"{"a": b", "c": 1}"#))
317    ///     .get_result::<i32>(connection)?;
318    ///
319    /// assert_eq!(7, result);
320    ///
321    /// let result = diesel::select(json_error_position::<Nullable<Binary>, _>(None::<Vec<u8>>))
322    ///     .get_result::<Option<i32>>(connection)?;
323    ///
324    /// assert_eq!(None, result);
325    ///
326    /// #     Ok(())
327    /// # }
328    /// ```
329    #[cfg(feature = "__sqlite-shared")]
330    fn json_error_position<
331        X: TextOrNullableTextOrBinaryOrNullableBinary + MaybeNullableValue<Integer>,
332    >(
333        x: X,
334    ) -> X::Out;
335
336    /// Extracts a text value from a well-formed JSON document at the given path.
337    ///
338    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
339    /// path is a JSON `null`.
340    ///
341    /// To extract other types, use:
342    /// - [`json_extract_integer`](json_extract_integer()) for integer values
343    /// - [`json_extract_double`](json_extract_double()) for floating-point values
344    /// - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays
345    ///
346    /// This function requires at least SQLite 3.9 or newer.
347    ///
348    /// # Example
349    ///
350    /// ```rust
351    /// # include!("../../doctest_setup.rs");
352    /// # fn main() {
353    /// #     #[cfg(feature = "serde_json")]
354    /// #     run_test().unwrap();
355    /// # }
356    /// # #[cfg(feature = "serde_json")]
357    /// # fn run_test() -> QueryResult<()> {
358    /// #     use diesel::dsl::*;
359    /// #     use diesel::sql_types::{Json, Nullable};
360    /// #     use serde_json::{json, Value};
361    /// #     let connection = &mut establish_connection();
362    /// #     assert_version!(connection, 3, 9, 0);
363    ///
364    /// let json = json!({"a": "xyz"});
365    /// let result = diesel::select(json_extract_string::<Json, _, _>(json, "$.a"))
366    ///     .get_result::<Option<String>>(connection)?;
367    /// assert_eq!(Some("xyz".to_string()), result);
368    ///
369    /// let json = json!({"a": 42});
370    /// let result = diesel::select(json_extract_string::<Json, _, _>(json, "$.a"))
371    ///     .get_result::<Option<String>>(connection)?;
372    /// assert_eq!(Some("42".to_string()), result);
373    ///
374    /// let result = diesel::select(json_extract_string::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
375    ///     .get_result::<Option<String>>(connection)?;
376    /// assert!(result.is_none());
377    ///
378    /// let json = json!({"a": "xyz"});
379    /// let result = diesel::select(json_extract_string::<Json, _, _>(json, "$.x"))
380    ///     .get_result::<Option<String>>(connection)?;
381    /// assert!(result.is_none());
382    ///
383    /// #     Ok(())
384    /// # }
385    /// ```
386    #[cfg(feature = "__sqlite-shared")]
387    #[sql_name = "json_extract"]
388    fn json_extract_string<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
389        json: J,
390        text: Text,
391    ) -> Nullable<Text>;
392
393    /// Extracts an integer value from a well-formed JSON document at the given path.
394    ///
395    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
396    /// path is a JSON `null`.
397    ///
398    /// To extract other types, use:
399    /// - [`json_extract_string`](json_extract_string()) for text values
400    /// - [`json_extract_double`](json_extract_double()) for floating-point values
401    /// - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays
402    ///
403    /// This function requires at least SQLite 3.9 or newer.
404    ///
405    /// # Example
406    ///
407    /// ```rust
408    /// # include!("../../doctest_setup.rs");
409    /// # fn main() {
410    /// #     #[cfg(feature = "serde_json")]
411    /// #     run_test().unwrap();
412    /// # }
413    /// # #[cfg(feature = "serde_json")]
414    /// # fn run_test() -> QueryResult<()> {
415    /// #     use diesel::dsl::*;
416    /// #     use diesel::sql_types::{Json, Nullable};
417    /// #     use serde_json::{json, Value};
418    /// #     let connection = &mut establish_connection();
419    /// #     assert_version!(connection, 3, 9, 0);
420    ///
421    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
422    /// let result = diesel::select(json_extract_integer::<Json, _, _>(json, "$.c[2].f"))
423    ///     .get_result::<Option<i32>>(connection)?;
424    /// assert_eq!(Some(7), result);
425    ///
426    /// let json = json!({"a": 3.7});
427    /// let result = diesel::select(json_extract_integer::<Json, _, _>(json, "$.a"))
428    ///     .get_result::<Option<i32>>(connection)?;
429    /// assert_eq!(Some(3), result);
430    ///
431    /// let result = diesel::select(json_extract_integer::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
432    ///     .get_result::<Option<i32>>(connection)?;
433    /// assert!(result.is_none());
434    ///
435    /// let json = json!({"a": 2});
436    /// let result = diesel::select(json_extract_integer::<Json, _, _>(json, "$.x"))
437    ///     .get_result::<Option<i32>>(connection)?;
438    /// assert!(result.is_none());
439    ///
440    /// #     Ok(())
441    /// # }
442    /// ```
443    #[cfg(feature = "__sqlite-shared")]
444    #[sql_name = "json_extract"]
445    fn json_extract_integer<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
446        json: J,
447        text: Text,
448    ) -> Nullable<Integer>;
449
450    /// Extracts a floating-point value from a well-formed JSON document at the given path.
451    ///
452    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
453    /// path is a JSON `null`.
454    ///
455    /// To extract other types, use:
456    /// - [`json_extract_string`](json_extract_string()) for text values
457    /// - [`json_extract_integer`](json_extract_integer()) for integer values
458    /// - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays
459    ///
460    /// This function requires at least SQLite 3.9 or newer.
461    ///
462    /// # Example
463    ///
464    /// ```rust
465    /// # include!("../../doctest_setup.rs");
466    /// # fn main() {
467    /// #     #[cfg(feature = "serde_json")]
468    /// #     run_test().unwrap();
469    /// # }
470    /// # #[cfg(feature = "serde_json")]
471    /// # fn run_test() -> QueryResult<()> {
472    /// #     use diesel::dsl::*;
473    /// #     use diesel::sql_types::{Json, Nullable};
474    /// #     use serde_json::{json, Value};
475    /// #     let connection = &mut establish_connection();
476    /// #     assert_version!(connection, 3, 9, 0);
477    ///
478    /// let json = json!({"a": 3.14});
479    /// let result = diesel::select(json_extract_double::<Json, _, _>(json, "$.a"))
480    ///     .get_result::<Option<f64>>(connection)?;
481    /// assert_eq!(Some(3.14), result);
482    ///
483    /// let json = json!({"a": 7});
484    /// let result = diesel::select(json_extract_double::<Json, _, _>(json, "$.a"))
485    ///     .get_result::<Option<f64>>(connection)?;
486    /// assert_eq!(Some(7.0), result);
487    ///
488    /// let result = diesel::select(json_extract_double::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
489    ///     .get_result::<Option<f64>>(connection)?;
490    /// assert!(result.is_none());
491    ///
492    /// let json = json!({"a": 3.14});
493    /// let result = diesel::select(json_extract_double::<Json, _, _>(json, "$.x"))
494    ///     .get_result::<Option<f64>>(connection)?;
495    /// assert!(result.is_none());
496    ///
497    /// #     Ok(())
498    /// # }
499    /// ```
500    #[cfg(feature = "__sqlite-shared")]
501    #[sql_name = "json_extract"]
502    fn json_extract_double<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
503        json: J,
504        text: Text,
505    ) -> Nullable<Double>;
506
507    /// Extracts a JSON object or array from a well-formed JSON document at the given path.
508    ///
509    /// When a single path is provided, returns the value at that path as a [`Json`] value.
510    /// When multiple paths are provided (using the variadic form), returns a JSON array
511    /// containing the extracted values.
512    ///
513    /// Returns `NULL` if a single path does not exist in the JSON document. With multiple paths,
514    /// missing paths appear as `null` inside the returned JSON array.
515    ///
516    /// To extract other types, use:
517    /// - [`json_extract_string`](json_extract_string()) for text values
518    /// - [`json_extract_integer`](json_extract_integer()) for integer values
519    /// - [`json_extract_double`](json_extract_double()) for floating-point values
520    ///
521    /// This function requires at least SQLite 3.9 or newer.
522    ///
523    /// # Example
524    ///
525    /// ```rust
526    /// # include!("../../doctest_setup.rs");
527    /// # fn main() {
528    /// #     #[cfg(feature = "serde_json")]
529    /// #     run_test().unwrap();
530    /// # }
531    /// # #[cfg(feature = "serde_json")]
532    /// # fn run_test() -> QueryResult<()> {
533    /// #     use diesel::dsl::*;
534    /// #     use diesel::sql_types::{Json, Nullable};
535    /// #     use serde_json::{json, Value};
536    /// #     let connection = &mut establish_connection();
537    /// #     assert_version!(connection, 3, 9, 0);
538    ///
539    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
540    /// let result = diesel::select(json_extract_json_1::<Json, _, _>(json, "$.c[2]"))
541    ///     .get_result::<Option<Value>>(connection)?;
542    /// assert_eq!(Some(json!({"f": 7})), result);
543    ///
544    /// let json = json!({"a": 2, "c": [4, 5], "f": 7});
545    /// let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, "$.c", "$.a"))
546    ///     .get_result::<Option<Value>>(connection)?;
547    /// assert_eq!(Some(json!([[4, 5], 2])), result);
548    ///
549    /// let json = json!({"a": 42});
550    /// let result = diesel::select(json_extract_json_1::<Json, _, _>(json, "$.a"))
551    ///     .get_result::<Option<Value>>(connection)?;
552    /// assert_eq!(Some(json!(42)), result);
553    ///
554    /// let json = json!({"a": 42});
555    /// let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, "$.a", "$.b"))
556    ///     .get_result::<Option<Value>>(connection)?;
557    /// assert_eq!(Some(json!([42, null])), result);
558    ///
559    /// let result = diesel::select(json_extract_json_1::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
560    ///     .get_result::<Option<Value>>(connection)?;
561    /// assert!(result.is_none());
562    ///
563    /// let json = json!({"a": 42});
564    /// let result = diesel::select(json_extract_json_1::<Json, _, _>(json, "$.x"))
565    ///     .get_result::<Option<Value>>(connection)?;
566    /// assert!(result.is_none());
567    ///
568    /// let json = json!({"a": 42});
569    /// let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, "$.b", "$.c"))
570    ///     .get_result::<Option<Value>>(connection)?;
571    /// assert_eq!(Some(json!([null, null])), result);
572    ///
573    /// #     Ok(())
574    /// # }
575    /// ```
576    #[cfg(feature = "__sqlite-shared")]
577    #[sql_name = "json_extract"]
578    #[variadic(last_arguments = 1, skip_zero_argument_variant = true)]
579    fn json_extract_json<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
580        json: J,
581        text: Text,
582    ) -> Nullable<Json>;
583
584    /// Extracts a text value from a well-formed JSON or JSONB document at the given path.
585    ///
586    /// Works identically to [`json_extract_string`](json_extract_string()) for scalar text values.
587    ///
588    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
589    /// path is a JSON `null`.
590    ///
591    /// To extract other types, use:
592    /// - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values
593    /// - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values
594    /// - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format
595    ///
596    /// This function requires at least SQLite 3.9 or newer.
597    ///
598    /// # Example
599    ///
600    /// ```rust
601    /// # include!("../../doctest_setup.rs");
602    /// # fn main() {
603    /// #     #[cfg(feature = "serde_json")]
604    /// #     run_test().unwrap();
605    /// # }
606    /// # #[cfg(feature = "serde_json")]
607    /// # fn run_test() -> QueryResult<()> {
608    /// #     use diesel::dsl::*;
609    /// #     use diesel::sql_types::{Json, Nullable};
610    /// #     use serde_json::{json, Value};
611    /// #     let connection = &mut establish_connection();
612    /// #     assert_version!(connection, 3, 9, 0);
613    ///
614    /// let json = json!({"a": "xyz"});
615    /// let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, "$.a"))
616    ///     .get_result::<Option<String>>(connection)?;
617    /// assert_eq!(Some("xyz".to_string()), result);
618    ///
619    /// let json = json!({"a": 42});
620    /// let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, "$.a"))
621    ///     .get_result::<Option<String>>(connection)?;
622    /// assert_eq!(Some("42".to_string()), result);
623    ///
624    /// let result = diesel::select(jsonb_extract_string::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
625    ///     .get_result::<Option<String>>(connection)?;
626    /// assert!(result.is_none());
627    ///
628    /// let json = json!({"a": "xyz"});
629    /// let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, "$.x"))
630    ///     .get_result::<Option<String>>(connection)?;
631    /// assert!(result.is_none());
632    ///
633    /// #     Ok(())
634    /// # }
635    /// ```
636    #[cfg(feature = "__sqlite-shared")]
637    #[sql_name = "jsonb_extract"]
638    fn jsonb_extract_string<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
639        json: J,
640        text: Text,
641    ) -> Nullable<Text>;
642
643    /// Extracts an integer value from a well-formed JSON or JSONB document at the given path.
644    ///
645    /// Works identically to [`json_extract_integer`](json_extract_integer()) for integer values.
646    ///
647    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
648    /// path is a JSON `null`.
649    ///
650    /// To extract other types, use:
651    /// - [`jsonb_extract_string`](jsonb_extract_string()) for text values
652    /// - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values
653    /// - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format
654    ///
655    /// This function requires at least SQLite 3.9 or newer.
656    ///
657    /// # Example
658    ///
659    /// ```rust
660    /// # include!("../../doctest_setup.rs");
661    /// # fn main() {
662    /// #     #[cfg(feature = "serde_json")]
663    /// #     run_test().unwrap();
664    /// # }
665    /// # #[cfg(feature = "serde_json")]
666    /// # fn run_test() -> QueryResult<()> {
667    /// #     use diesel::dsl::*;
668    /// #     use diesel::sql_types::{Json, Nullable};
669    /// #     use serde_json::{json, Value};
670    /// #     let connection = &mut establish_connection();
671    /// #     assert_version!(connection, 3, 9, 0);
672    ///
673    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
674    /// let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, "$.c[2].f"))
675    ///     .get_result::<Option<i32>>(connection)?;
676    /// assert_eq!(Some(7), result);
677    ///
678    /// let json = json!({"a": 3.7});
679    /// let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, "$.a"))
680    ///     .get_result::<Option<i32>>(connection)?;
681    /// assert_eq!(Some(3), result);
682    ///
683    /// let result = diesel::select(jsonb_extract_integer::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
684    ///     .get_result::<Option<i32>>(connection)?;
685    /// assert!(result.is_none());
686    ///
687    /// let json = json!({"a": 2});
688    /// let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, "$.x"))
689    ///     .get_result::<Option<i32>>(connection)?;
690    /// assert!(result.is_none());
691    ///
692    /// #     Ok(())
693    /// # }
694    /// ```
695    #[cfg(feature = "__sqlite-shared")]
696    #[sql_name = "jsonb_extract"]
697    fn jsonb_extract_integer<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
698        json: J,
699        text: Text,
700    ) -> Nullable<Integer>;
701
702    /// Extracts a floating-point value from a well-formed JSON or JSONB document at the given path.
703    ///
704    /// Works identically to [`json_extract_double`](json_extract_double()) for floating-point values.
705    ///
706    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
707    /// path is a JSON `null`.
708    ///
709    /// To extract other types, use:
710    /// - [`jsonb_extract_string`](jsonb_extract_string()) for text values
711    /// - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values
712    /// - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format
713    ///
714    /// This function requires at least SQLite 3.9 or newer.
715    ///
716    /// # Example
717    ///
718    /// ```rust
719    /// # include!("../../doctest_setup.rs");
720    /// # fn main() {
721    /// #     #[cfg(feature = "serde_json")]
722    /// #     run_test().unwrap();
723    /// # }
724    /// # #[cfg(feature = "serde_json")]
725    /// # fn run_test() -> QueryResult<()> {
726    /// #     use diesel::dsl::*;
727    /// #     use diesel::sql_types::{Json, Nullable};
728    /// #     use serde_json::{json, Value};
729    /// #     let connection = &mut establish_connection();
730    /// #     assert_version!(connection, 3, 9, 0);
731    ///
732    /// let json = json!({"a": 3.14});
733    /// let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, "$.a"))
734    ///     .get_result::<Option<f64>>(connection)?;
735    /// assert_eq!(Some(3.14), result);
736    ///
737    /// let json = json!({"a": 7});
738    /// let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, "$.a"))
739    ///     .get_result::<Option<f64>>(connection)?;
740    /// assert_eq!(Some(7.0), result);
741    ///
742    /// let result = diesel::select(jsonb_extract_double::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
743    ///     .get_result::<Option<f64>>(connection)?;
744    /// assert!(result.is_none());
745    ///
746    /// let json = json!({"a": 3.14});
747    /// let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, "$.x"))
748    ///     .get_result::<Option<f64>>(connection)?;
749    /// assert!(result.is_none());
750    ///
751    /// #     Ok(())
752    /// # }
753    /// ```
754    #[cfg(feature = "__sqlite-shared")]
755    #[sql_name = "jsonb_extract"]
756    fn jsonb_extract_double<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
757        json: J,
758        text: Text,
759    ) -> Nullable<Double>;
760
761    /// Extracts a JSON object or array from a well-formed JSON or JSONB document at the given path,
762    /// returning it in JSONB format.
763    ///
764    /// Unlike [`json_extract_json`](json_extract_json_1()), which returns JSON objects and arrays
765    /// as text, this function returns them in the internal JSONB binary format. For scalar values
766    /// (text, integer, double, null), both functions behave identically.
767    ///
768    /// When a single path is provided, returns the value at that path as a [`Jsonb`] value.
769    /// When multiple paths are provided (using the variadic form), returns a JSONB array
770    /// containing the extracted values.
771    ///
772    /// Returns `NULL` if a single path does not exist in the JSON document. With multiple paths,
773    /// missing paths appear as `null` inside the returned JSONB array.
774    ///
775    /// To extract other types, use:
776    /// - [`jsonb_extract_string`](jsonb_extract_string()) for text values
777    /// - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values
778    /// - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values
779    ///
780    /// This function requires at least SQLite 3.9 or newer.
781    ///
782    /// # Example
783    ///
784    /// ```rust
785    /// # include!("../../doctest_setup.rs");
786    /// # fn main() {
787    /// #     #[cfg(feature = "serde_json")]
788    /// #     run_test().unwrap();
789    /// # }
790    /// # #[cfg(feature = "serde_json")]
791    /// # fn run_test() -> QueryResult<()> {
792    /// #     use diesel::dsl::*;
793    /// #     use diesel::sql_types::{Json, Jsonb, Nullable};
794    /// #     use serde_json::{json, Value};
795    /// #     let connection = &mut establish_connection();
796    /// #     assert_version!(connection, 3, 9, 0);
797    ///
798    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
799    /// let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, "$"))
800    ///     .get_result::<Option<Value>>(connection)?;
801    /// assert_eq!(Some(json!({"a": 2, "c": [4, 5, {"f": 7}]})), result);
802    ///
803    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
804    /// let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, "$.c"))
805    ///     .get_result::<Option<Value>>(connection)?;
806    /// assert_eq!(Some(json!([4, 5, {"f": 7}])), result);
807    ///
808    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
809    /// let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, "$.c[2]"))
810    ///     .get_result::<Option<Value>>(connection)?;
811    /// assert_eq!(Some(json!({"f": 7})), result);
812    ///
813    /// let json = json!({"a": 2, "c": [4, 5]});
814    /// let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, "$.c", "$.x"))
815    ///     .get_result::<Option<Value>>(connection)?;
816    /// assert_eq!(Some(json!([[4, 5], null])), result);
817    ///
818    /// let result = diesel::select(jsonb_extract_jsonb_1::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
819    ///     .get_result::<Option<Value>>(connection)?;
820    /// assert!(result.is_none());
821    ///
822    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
823    /// let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, "$.x"))
824    ///     .get_result::<Option<Value>>(connection)?;
825    /// assert_eq!(None, result);
826    ///
827    /// let json = json!({"a": 2, "c": [4, 5], "f": 7});
828    /// let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, "$.c", "$.a"))
829    ///     .get_result::<Option<Value>>(connection)?;
830    /// assert_eq!(Some(json!([[4, 5], 2])), result);
831    ///
832    /// let json = json!({"a": 2});
833    /// let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, "$.b", "$.c"))
834    ///     .get_result::<Option<Value>>(connection)?;
835    /// assert_eq!(Some(json!([null, null])), result);
836    ///
837    /// #     Ok(())
838    /// # }
839    /// ```
840    #[cfg(feature = "__sqlite-shared")]
841    #[sql_name = "jsonb_extract"]
842    #[variadic(last_arguments = 1, skip_zero_argument_variant = true)]
843    fn jsonb_extract_jsonb<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
844        json: J,
845        text: Text,
846    ) -> Nullable<Jsonb>;
847
848    /// Converts the given json value to pretty-printed, indented text
849    ///
850    /// This function requires at least SQLite 3.46 or newer
851    ///
852    /// # Example
853    ///
854    /// ```rust
855    /// # include!("../../doctest_setup.rs");
856    /// #
857    /// # fn main() {
858    /// #     #[cfg(feature = "serde_json")]
859    /// #     run_test().unwrap();
860    /// # }
861    /// #
862    /// # #[cfg(feature = "serde_json")]
863    /// # fn run_test() -> QueryResult<()> {
864    /// #     use diesel::dsl::{sql, json_pretty};
865    /// #     use serde_json::{json, Value};
866    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
867    /// #     let connection = &mut establish_connection();
868    /// #     assert_version!(connection, 3, 46, 0);
869    ///
870    /// let result = diesel::select(json_pretty::<Json, _>(json!([{"f1":1,"f2":null},2,null,3])))
871    ///     .get_result::<String>(connection)?;
872    ///
873    /// assert_eq!(r#"[
874    ///     {
875    ///         "f1": 1,
876    ///         "f2": null
877    ///     },
878    ///     2,
879    ///     null,
880    ///     3
881    /// ]"#, result);
882    ///
883    /// let result = diesel::select(json_pretty::<Json, _>(json!({"a": 1, "b": "cd"})))
884    ///     .get_result::<String>(connection)?;
885    ///
886    /// assert_eq!(r#"{
887    ///     "a": 1,
888    ///     "b": "cd"
889    /// }"#, result);
890    ///
891    /// let result = diesel::select(json_pretty::<Json, _>(json!("abc")))
892    ///     .get_result::<String>(connection)?;
893    ///
894    /// assert_eq!(r#""abc""#, result);
895    ///
896    /// let result = diesel::select(json_pretty::<Json, _>(json!(22)))
897    ///     .get_result::<String>(connection)?;
898    ///
899    /// assert_eq!(r#"22"#, result);
900    ///
901    /// let result = diesel::select(json_pretty::<Json, _>(json!(false)))
902    ///     .get_result::<String>(connection)?;
903    ///
904    /// assert_eq!(r#"false"#, result);
905    ///
906    /// let result = diesel::select(json_pretty::<Json, _>(json!(null)))
907    ///     .get_result::<String>(connection)?;
908    ///
909    /// assert_eq!(r#"null"#, result);
910    ///
911    /// let result = diesel::select(json_pretty::<Json, _>(json!({})))
912    ///     .get_result::<String>(connection)?;
913    ///
914    /// assert_eq!(r#"{}"#, result);
915    ///
916    /// let result = diesel::select(json_pretty::<Nullable<Json>, _>(None::<Value>))
917    ///     .get_result::<Option<String>>(connection)?;
918    ///
919    /// assert!(result.is_none());
920    ///
921    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!([{"f1":1,"f2":null},2,null,3])))
922    ///     .get_result::<String>(connection)?;
923    ///
924    /// assert_eq!(r#"[
925    ///     {
926    ///         "f1": 1,
927    ///         "f2": null
928    ///     },
929    ///     2,
930    ///     null,
931    ///     3
932    /// ]"#, result);
933    ///
934    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!({"a": 1, "b": "cd"})))
935    ///     .get_result::<String>(connection)?;
936    ///
937    /// assert_eq!(r#"{
938    ///     "a": 1,
939    ///     "b": "cd"
940    /// }"#, result);
941    ///
942    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!("abc")))
943    ///     .get_result::<String>(connection)?;
944    ///
945    /// assert_eq!(r#""abc""#, result);
946    ///
947    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!(22)))
948    ///     .get_result::<String>(connection)?;
949    ///
950    /// assert_eq!(r#"22"#, result);
951    ///
952    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!(false)))
953    ///     .get_result::<String>(connection)?;
954    ///
955    /// assert_eq!(r#"false"#, result);
956    ///
957    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!(null)))
958    ///     .get_result::<String>(connection)?;
959    ///
960    /// assert_eq!(r#"null"#, result);
961    ///
962    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!({})))
963    ///     .get_result::<String>(connection)?;
964    ///
965    /// assert_eq!(r#"{}"#, result);
966    ///
967    /// let result = diesel::select(json_pretty::<Nullable<Jsonb>, _>(None::<Value>))
968    ///     .get_result::<Option<String>>(connection)?;
969    ///
970    /// assert!(result.is_none());
971    /// #     Ok(())
972    /// # }
973    /// ```
974    fn json_pretty<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Text>>(
975        j: J,
976    ) -> J::Out;
977
978    /// Converts the given json value to pretty-printed, indented text
979    ///
980    /// This function requires at least SQLite 3.46 or newer
981    ///
982    /// # Example
983    ///
984    /// ```rust
985    /// # include!("../../doctest_setup.rs");
986    /// #
987    /// # fn main() {
988    /// #     #[cfg(feature = "serde_json")]
989    /// #     run_test().unwrap();
990    /// # }
991    /// #
992    /// # #[cfg(feature = "serde_json")]
993    /// # fn run_test() -> QueryResult<()> {
994    /// #     use diesel::dsl::{sql, json_pretty_with_indentation};
995    /// #     use serde_json::{json, Value};
996    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
997    /// #     let connection = &mut establish_connection();
998    /// #     assert_version!(connection, 3, 46, 0);
999    ///
1000    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!([{"f1":1,"f2":null},2,null,3]), "  "))
1001    ///     .get_result::<String>(connection)?;
1002    ///
1003    /// assert_eq!(r#"[
1004    ///   {
1005    ///     "f1": 1,
1006    ///     "f2": null
1007    ///   },
1008    ///   2,
1009    ///   null,
1010    ///   3
1011    /// ]"#, result);
1012    ///
1013    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!([{"f1":1,"f2":null},2,null,3]), None::<&str>))
1014    ///     .get_result::<String>(connection)?;
1015    ///
1016    /// assert_eq!(r#"[
1017    ///     {
1018    ///         "f1": 1,
1019    ///         "f2": null
1020    ///     },
1021    ///     2,
1022    ///     null,
1023    ///     3
1024    /// ]"#, result);
1025    ///
1026    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!({"a": 1, "b": "cd"}), "  "))
1027    ///     .get_result::<String>(connection)?;
1028    ///
1029    /// assert_eq!(r#"{
1030    ///   "a": 1,
1031    ///   "b": "cd"
1032    /// }"#, result);
1033    ///
1034    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!("abc"), "  "))
1035    ///     .get_result::<String>(connection)?;
1036    ///
1037    /// assert_eq!(r#""abc""#, result);
1038    ///
1039    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(22), "  "))
1040    ///     .get_result::<String>(connection)?;
1041    ///
1042    /// assert_eq!(r#"22"#, result);
1043    ///
1044    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(false), None::<&str>))
1045    ///     .get_result::<String>(connection)?;
1046    ///
1047    /// assert_eq!(r#"false"#, result);
1048    ///
1049    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(null), None::<&str>))
1050    ///     .get_result::<String>(connection)?;
1051    ///
1052    /// assert_eq!(r#"null"#, result);
1053    ///
1054    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!({}), "  "))
1055    ///     .get_result::<String>(connection)?;
1056    ///
1057    /// assert_eq!(r#"{}"#, result);
1058    ///
1059    /// let result = diesel::select(json_pretty_with_indentation::<Nullable<Json>, _, _>(None::<Value>, None::<&str>))
1060    ///     .get_result::<Option<String>>(connection)?;
1061    ///
1062    /// assert!(result.is_none());
1063    ///
1064    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!([{"f1":1,"f2":null},2,null,3]), "  "))
1065    ///     .get_result::<String>(connection)?;
1066    ///
1067    /// assert_eq!(r#"[
1068    ///   {
1069    ///     "f1": 1,
1070    ///     "f2": null
1071    ///   },
1072    ///   2,
1073    ///   null,
1074    ///   3
1075    /// ]"#, result);
1076    ///
1077    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!([{"f1":1,"f2":null},2,null,3]), None::<&str>))
1078    ///     .get_result::<String>(connection)?;
1079    ///
1080    /// assert_eq!(r#"[
1081    ///     {
1082    ///         "f1": 1,
1083    ///         "f2": null
1084    ///     },
1085    ///     2,
1086    ///     null,
1087    ///     3
1088    /// ]"#, result);
1089    ///
1090    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!({"a": 1, "b": "cd"}), "  "))
1091    ///     .get_result::<String>(connection)?;
1092    ///
1093    /// assert_eq!(r#"{
1094    ///   "a": 1,
1095    ///   "b": "cd"
1096    /// }"#, result);
1097    ///
1098    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!("abc"), "  "))
1099    ///     .get_result::<String>(connection)?;
1100    ///
1101    /// assert_eq!(r#""abc""#, result);
1102    ///
1103    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(22), "  "))
1104    ///     .get_result::<String>(connection)?;
1105    ///
1106    /// assert_eq!(r#"22"#, result);
1107    ///
1108    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(false), None::<&str>))
1109    ///     .get_result::<String>(connection)?;
1110    ///
1111    /// assert_eq!(r#"false"#, result);
1112    ///
1113    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(null), None::<&str>))
1114    ///     .get_result::<String>(connection)?;
1115    ///
1116    /// assert_eq!(r#"null"#, result);
1117    ///
1118    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!({}), "  "))
1119    ///     .get_result::<String>(connection)?;
1120    ///
1121    /// assert_eq!(r#"{}"#, result);
1122    ///
1123    /// let result = diesel::select(json_pretty_with_indentation::<Nullable<Jsonb>, _, _>(None::<Value>, None::<&str>))
1124    ///     .get_result::<Option<String>>(connection)?;
1125    ///
1126    /// assert!(result.is_none());
1127    ///
1128    /// #     Ok(())
1129    /// # }
1130    /// ```
1131    #[sql_name = "json_pretty"]
1132    fn json_pretty_with_indentation<
1133        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Text>,
1134    >(
1135        j: J,
1136        indentation: Nullable<Text>,
1137    ) -> J::Out;
1138
1139    /// Returns  `true`  if the argument is well-formed JSON, or returns  `false`  if is not well-formed.
1140    ///
1141    /// This function requires at least SQLite 3.46 or newer
1142    ///
1143    /// # Example
1144    ///
1145    /// ```rust
1146    /// # include!("../../doctest_setup.rs");
1147    /// #
1148    /// # fn main() {
1149    /// #     #[cfg(feature = "serde_json")]
1150    /// #     run_test().unwrap();
1151    /// # }
1152    /// #
1153    /// # #[cfg(feature = "serde_json")]
1154    /// # fn run_test() -> QueryResult<()> {
1155    /// #     use diesel::dsl::{sql, json_valid};
1156    /// #     use serde_json::{json, Value};
1157    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1158    /// #     let connection = &mut establish_connection();
1159    /// #     assert_version!(connection, 3, 46, 0);
1160    ///
1161    /// let result = diesel::select(json_valid::<Json, _>(json!({"x":35})))
1162    ///     .get_result::<bool>(connection)?;
1163    ///
1164    /// assert_eq!(true, result);
1165    ///
1166    /// let result = diesel::select(json_valid::<Nullable<Json>, _>(None::<serde_json::Value>))
1167    ///     .get_result::<Option<bool>>(connection)?;
1168    ///
1169    /// assert_eq!(None, result);
1170    ///
1171    /// # Ok(())
1172    /// # }
1173    /// ```
1174    #[sql_name = "json_valid"]
1175    #[cfg(feature = "__sqlite-shared")]
1176    fn json_valid<J: JsonOrNullableJson + MaybeNullableValue<Bool>>(j: J) -> J::Out;
1177
1178    /// The json_valid(X,Y) function returns 1 if the argument X is well-formed JSON, or returns 0 if X is not well-formed.
1179    /// The Y parameter is an integer bitmask that defines what is meant by "well-formed".
1180    ///
1181    /// The following bits of Y are currently defined:
1182    /// - 0x01 → The input is text that strictly complies with canonical RFC-8259 JSON, without any extensions.
1183    /// - 0x02 → The input is text that is JSON with JSON5 extensions.
1184    /// - 0x04 → The input is a BLOB that superficially appears to be JSONB.
1185    /// - 0x08 → The input is a BLOB that strictly conforms to the internal JSONB format.
1186    ///
1187    /// By combining bits, the following useful values of Y can be derived:
1188    /// - 1 → X is RFC-8259 JSON text
1189    /// - 2 → X is JSON5 text
1190    /// - 4 → X is probably JSONB
1191    /// - 5 → X is RFC-8259 JSON text or JSONB
1192    /// - 6 → X is JSON5 text or JSONB (recommended for most use cases)
1193    /// - 8 → X is strictly conforming JSONB
1194    /// - 9 → X is RFC-8259 or strictly conforming JSONB
1195    /// - 10 → X is JSON5 or strictly conforming JSONB
1196    ///
1197    /// The Y parameter must be between 1 and 15 (inclusive), or an error is raised.
1198    ///
1199    /// If either X or Y inputs are NULL, then the function returns NULL.
1200    ///
1201    /// This function requires at least SQLite 3.46 or newer
1202    ///
1203    /// # Example
1204    ///
1205    /// ```rust
1206    /// # include!("../../doctest_setup.rs");
1207    /// #
1208    /// # fn main() {
1209    /// #     #[cfg(feature = "serde_json")]
1210    /// #     run_test().unwrap();
1211    /// # }
1212    /// #
1213    /// # #[cfg(feature = "serde_json")]
1214    /// # fn run_test() -> QueryResult<()> {
1215    /// #     use diesel::dsl::{sql, json_valid_with_flags};
1216    /// #     use diesel::sqlite::JsonValidFlag;
1217    /// #     use serde_json::{json, Value};
1218    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1219    /// #     let connection = &mut establish_connection();
1220    /// #     assert_version!(connection, 3, 46, 0);
1221    ///
1222    /// // Standard RFC-8259 JSON
1223    /// let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#"{"x":35}"#, JsonValidFlag::Rfc8259Json))
1224    ///     .get_result::<bool>(connection)?;
1225    /// assert_eq!(true, result);
1226    ///
1227    /// // JSON5 not valid as RFC-8259
1228    /// let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#"{x:35}"#, JsonValidFlag::Rfc8259Json))
1229    ///     .get_result::<bool>(connection)?;
1230    /// assert_eq!(false, result);
1231    ///
1232    /// // JSON5 valid with JSON5 flag
1233    /// let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#"{x:35}"#, JsonValidFlag::Json5OrJsonb))
1234    ///     .get_result::<bool>(connection)?;
1235    /// assert_eq!(true, result);
1236    ///
1237    /// // Invalid JSON
1238    /// let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#"{"x":35"#, JsonValidFlag::Rfc8259Json))
1239    ///     .get_result::<bool>(connection)?;
1240    /// assert_eq!(false, result);
1241    ///
1242    /// // NULL input returns NULL
1243    /// let result = diesel::select(json_valid_with_flags::<Nullable<Text>, _, _>(None::<&str>, JsonValidFlag::Rfc8259Json))
1244    ///     .get_result::<Option<bool>>(connection)?;
1245    /// assert_eq!(None, result);
1246    ///
1247    /// # Ok(())
1248    /// # }
1249    /// ```
1250    #[sql_name = "json_valid"]
1251    #[cfg(feature = "__sqlite-shared")]
1252    fn json_valid_with_flags<
1253        X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue + MaybeNullableValue<Bool>,
1254    >(
1255        x: X,
1256        flags: crate::sqlite::types::JsonValidFlags,
1257    ) -> X::Out;
1258
1259    /// The json_type(X) function returns the "type" of the outermost element of X.
1260    /// The "type" returned by json_type() is one of the following SQL text values:
1261    /// 'null', 'true', 'false', 'integer', 'real', 'text', 'array', or 'object'.
1262    ///
1263    /// This function requires at least SQLite 3.38 or newer
1264    ///
1265    /// # Example
1266    ///
1267    /// ```rust
1268    /// # include!("../../doctest_setup.rs");
1269    /// #
1270    /// # fn main() {
1271    /// #     #[cfg(feature = "serde_json")]
1272    /// #     run_test().unwrap();
1273    /// # }
1274    /// #
1275    /// # #[cfg(feature = "serde_json")]
1276    /// # fn run_test() -> QueryResult<()> {
1277    /// #     use diesel::dsl::{sql, json_type};
1278    /// #     use serde_json::{json, Value};
1279    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1280    /// #     let connection = &mut establish_connection();
1281    /// #     assert_version!(connection, 3, 38, 0);
1282    ///
1283    /// let result = diesel::select(json_type::<Json, _>(json!({"a": [2, 3.5, true, false, null, "x"]})))
1284    ///     .get_result::<String>(connection)?;
1285    ///
1286    /// assert_eq!("object", result);
1287    ///
1288    /// let result = diesel::select(json_type::<Jsonb, _>(json!({"a": [2, 3.5, true, false, null, "x"]})))
1289    ///     .get_result::<String>(connection)?;
1290    ///
1291    /// assert_eq!("object", result);
1292    ///
1293    /// let result = diesel::select(json_type::<Nullable<Json>, _>(None::<serde_json::Value>))
1294    ///     .get_result::<Option<String>>(connection)?;
1295    ///
1296    /// assert_eq!(None, result);
1297    ///
1298    /// # Ok(())
1299    /// # }
1300    /// ```
1301    #[sql_name = "json_type"]
1302    #[cfg(feature = "__sqlite-shared")]
1303    fn json_type<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Text>>(
1304        j: J,
1305    ) -> J::Out;
1306
1307    /// The json_type(X,P) function returns the "type" of the element in X that is selected by path P.
1308    /// If the path P in json_type(X,P) selects an element that does not exist in X, then this function returns NULL.
1309    ///
1310    /// This function requires at least SQLite 3.38 or newer
1311    ///
1312    /// # Example
1313    ///
1314    /// ```rust
1315    /// # include!("../../doctest_setup.rs");
1316    /// #
1317    /// # fn main() {
1318    /// #     #[cfg(feature = "serde_json")]
1319    /// #     run_test().unwrap();
1320    /// # }
1321    /// #
1322    /// # #[cfg(feature = "serde_json")]
1323    /// # fn run_test() -> QueryResult<()> {
1324    /// #     use diesel::dsl::{sql, json_type_with_path};
1325    /// #     use serde_json::{json, Value};
1326    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1327    /// #     let connection = &mut establish_connection();
1328    /// #     assert_version!(connection, 3, 38, 0);
1329    ///
1330    /// let json_value = json!({"a": [2, 3.5, true, false, null, "x"]});
1331    ///
1332    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a"))
1333    ///     .get_result::<Option<String>>(connection)?;
1334    ///
1335    /// assert_eq!(Some("array".to_string()), result);
1336    ///
1337    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a[0]"))
1338    ///     .get_result::<Option<String>>(connection)?;
1339    ///
1340    /// assert_eq!(Some("integer".to_string()), result);
1341    ///
1342    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a[1]"))
1343    ///     .get_result::<Option<String>>(connection)?;
1344    ///
1345    /// assert_eq!(Some("real".to_string()), result);
1346    ///
1347    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a[2]"))
1348    ///     .get_result::<Option<String>>(connection)?;
1349    ///
1350    /// assert_eq!(Some("true".to_string()), result);
1351    ///
1352    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a[6]"))
1353    ///     .get_result::<Option<String>>(connection)?;
1354    ///
1355    /// assert_eq!(None, result);
1356    ///
1357    /// let result = diesel::select(json_type_with_path::<Jsonb, _, _>(json_value.clone(), "$.a"))
1358    ///     .get_result::<Option<String>>(connection)?;
1359    ///
1360    /// assert_eq!(Some("array".to_string()), result);
1361    ///
1362    /// let result = diesel::select(json_type_with_path::<Nullable<Json>, _, _>(None::<serde_json::Value>, "$.a"))
1363    ///     .get_result::<Option<String>>(connection)?;
1364    ///
1365    /// assert_eq!(None, result);
1366    ///
1367    /// # Ok(())
1368    /// # }
1369    /// ```
1370    #[sql_name = "json_type"]
1371    #[cfg(feature = "__sqlite-shared")]
1372    fn json_type_with_path<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
1373        j: J,
1374        path: Text,
1375    ) -> Nullable<Text>;
1376
1377    /// The json_quote(X) function converts the SQL value X (a number or a string) into its corresponding JSON
1378    /// representation. If X is a JSON value returned by another JSON function, then this function is a no-op.
1379    ///
1380    /// This function requires at least SQLite 3.38 or newer
1381    ///
1382    /// # Example
1383    ///
1384    /// ```rust
1385    /// # include!("../../doctest_setup.rs");
1386    /// #
1387    /// # fn main() {
1388    /// #     #[cfg(feature = "serde_json")]
1389    /// #     run_test().unwrap();
1390    /// # }
1391    /// #
1392    /// # #[cfg(feature = "serde_json")]
1393    /// # fn run_test() -> QueryResult<()> {
1394    /// #     use diesel::dsl::{sql, json_quote};
1395    /// #     use serde_json::{json, Value};
1396    /// #     use diesel::sql_types::{Text, Json, Integer, Float, Double, Nullable};
1397    /// #     let connection = &mut establish_connection();
1398    /// #     assert_version!(connection, 3, 38, 0);
1399    ///
1400    /// let result = diesel::select(json_quote::<Integer, _>(42))
1401    ///     .get_result::<Value>(connection)?;
1402    /// assert_eq!(json!(42), result);
1403    ///
1404    /// let result = diesel::select(json_quote::<Text, _>("verdant"))
1405    ///     .get_result::<Value>(connection)?;
1406    /// assert_eq!(json!("verdant"), result);
1407    ///
1408    /// let result = diesel::select(json_quote::<Text, _>("[1]"))
1409    ///     .get_result::<Value>(connection)?;
1410    /// assert_eq!(json!("[1]"), result);
1411    ///
1412    /// let result = diesel::select(json_quote::<Nullable<Text>, _>(None::<&str>))
1413    ///     .get_result::<Value>(connection)?;
1414    /// assert_eq!(json!(null), result);
1415    ///
1416    /// let result = diesel::select(json_quote::<Double, _>(3.14159))
1417    ///     .get_result::<Value>(connection)?;
1418    /// assert_eq!(json!(3.14159), result);
1419    ///
1420    /// let result = diesel::select(json_quote::<Json, _>(json!([1])))
1421    ///     .get_result::<Value>(connection)?;
1422    // assert_eq!(json!([1]), result);
1423    ///
1424    ///
1425    /// # Ok(())
1426    /// # }
1427    /// ```
1428    #[sql_name = "json_quote"]
1429    #[cfg(feature = "__sqlite-shared")]
1430    fn json_quote<J: SqlType + SingleValue>(j: J) -> Json;
1431
1432    /// The `json_group_array(X)` function is an aggregate SQL function that returns a JSON array comprised of
1433    /// all X values in the aggregation.
1434    ///
1435    /// ## Aggregate Function Expression
1436    ///
1437    /// This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details.
1438    ///
1439    /// # Examples
1440    ///
1441    /// ## Normal function usage
1442    ///
1443    /// ```rust
1444    /// # include!("../../doctest_setup.rs");
1445    /// #
1446    /// # fn main() {
1447    /// #     #[cfg(feature = "serde_json")]
1448    /// #     run_test().unwrap();
1449    /// # }
1450    /// #
1451    /// # #[cfg(feature = "serde_json")]
1452    /// # fn run_test() -> QueryResult<()> {
1453    /// #     use diesel::dsl::*;
1454    /// #     use schema::animals::dsl::*;
1455    /// #     use serde_json::json;
1456    /// #
1457    /// #     let connection = &mut establish_connection();
1458    /// #
1459    /// let result = animals
1460    ///     .select(json_group_array(species))
1461    ///     .get_result::<serde_json::Value>(connection)?;
1462    /// assert_eq!(result, json!(["dog", "spider"]));
1463    ///
1464    /// let result = animals
1465    ///     .select(json_group_array(legs))
1466    ///     .get_result::<serde_json::Value>(connection)?;
1467    /// assert_eq!(result, json!([4, 8]));
1468    ///
1469    /// let result = animals
1470    ///     .select(json_group_array(name))
1471    ///     .get_result::<serde_json::Value>(connection)?;
1472    /// assert_eq!(result, json!(["Jack", null]));
1473    ///
1474    /// # Ok(())
1475    /// # }
1476    /// ```
1477    /// ## Aggregate function expression
1478    ///
1479    /// ```rust
1480    /// # include!("../../doctest_setup.rs");
1481    /// #
1482    /// # fn main() {
1483    /// #     #[cfg(feature = "serde_json")]
1484    /// #     run_test().unwrap();
1485    /// # }
1486    /// #
1487    /// # #[cfg(feature = "serde_json")]
1488    /// # fn run_test() -> QueryResult<()> {
1489    /// #     use diesel::dsl::*;
1490    /// #     use schema::animals::dsl::*;
1491    /// #     use serde_json::json;
1492    /// #
1493    /// #     let connection = &mut establish_connection();
1494    /// #
1495    /// let result = animals
1496    ///     .select(json_group_array(species).aggregate_filter(legs.lt(8)))
1497    ///     .get_result::<serde_json::Value>(connection)?;
1498    /// assert_eq!(result, json!(["dog"]));
1499    ///
1500    /// # Ok(())
1501    /// # }
1502    /// ```
1503    ///
1504    /// # See also
1505    /// - [`jsonb_group_array`](jsonb_group_array()) will return data in JSONB format instead of JSON.
1506    /// - [`json_group_object`](json_group_object()) will return JSON object instead of array.
1507    #[cfg(feature = "__sqlite-shared")]
1508    #[aggregate]
1509    fn json_group_array<E: SqlType + SingleValue>(elements: E) -> Json;
1510
1511    /// The `jsonb_group_array(X)` function is an aggregate SQL function that returns a JSONB array comprised of
1512    /// all X values in the aggregation.
1513    ///
1514    /// ## Aggregate Function Expression
1515    ///
1516    /// This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details.
1517    ///
1518    /// # Examples
1519    ///
1520    /// ## Normal function usage
1521    ///
1522    /// ```rust
1523    /// # include!("../../doctest_setup.rs");
1524    /// #
1525    /// # fn main() {
1526    /// #     #[cfg(feature = "serde_json")]
1527    /// #     run_test().unwrap();
1528    /// # }
1529    /// #
1530    /// # #[cfg(feature = "serde_json")]
1531    /// # fn run_test() -> QueryResult<()> {
1532    /// #     use diesel::dsl::*;
1533    /// #     use schema::animals::dsl::*;
1534    /// #     use serde_json::json;
1535    /// #
1536    /// #     let connection = &mut establish_connection();
1537    /// #
1538    /// let result = animals
1539    ///     .select(json_group_array(species))
1540    ///     .get_result::<serde_json::Value>(connection)?;
1541    /// assert_eq!(result, json!(["dog", "spider"]));
1542    ///
1543    /// let result = animals
1544    ///     .select(json_group_array(legs))
1545    ///     .get_result::<serde_json::Value>(connection)?;
1546    /// assert_eq!(result, json!([4, 8]));
1547    ///
1548    /// let result = animals
1549    ///     .select(json_group_array(name))
1550    ///     .get_result::<serde_json::Value>(connection)?;
1551    /// assert_eq!(result, json!(["Jack", null]));
1552    ///
1553    /// # Ok(())
1554    /// # }
1555    /// ```
1556    ///
1557    /// ## Aggregate function expression
1558    ///
1559    /// ```rust
1560    /// # include!("../../doctest_setup.rs");
1561    /// #
1562    /// # fn main() {
1563    /// #     #[cfg(feature = "serde_json")]
1564    /// #     run_test().unwrap();
1565    /// # }
1566    /// #
1567    /// # #[cfg(feature = "serde_json")]
1568    /// # fn run_test() -> QueryResult<()> {
1569    /// #     use diesel::dsl::*;
1570    /// #     use schema::animals::dsl::*;
1571    /// #     use serde_json::json;
1572    /// #
1573    /// #     let connection = &mut establish_connection();
1574    /// #
1575    /// let result = animals
1576    ///     .select(json_group_array(species).aggregate_filter(legs.lt(8)))
1577    ///     .get_result::<serde_json::Value>(connection)?;
1578    /// assert_eq!(result, json!(["dog"]));
1579    ///
1580    /// # Ok(())
1581    /// # }
1582    /// ```
1583    ///
1584    /// # See also
1585    /// - [`json_group_array`](json_group_array()) will return data in JSON format instead of JSONB.
1586    /// - [`jsonb_group_object`](jsonb_group_object()) will return JSONB object instead of array.
1587    #[cfg(feature = "__sqlite-shared")]
1588    #[aggregate]
1589    fn jsonb_group_array<E: SqlType + SingleValue>(elements: E) -> Jsonb;
1590
1591    /// The `json_object()` SQL function accepts zero or more pairs of arguments and returns a
1592    /// well-formed JSON object composed from those pairs. The first argument of each pair is the
1593    /// label (key) and the second argument is the value. If any argument to `json_object()` is a
1594    /// BLOB then an error is thrown.
1595    ///
1596    /// An argument with SQL type TEXT is normally converted into a quoted JSON string even if the
1597    /// input text is well-formed JSON. However, if the argument is the direct result from another
1598    /// JSON function, then it is treated as JSON and all of its JSON type information and
1599    /// substructure is preserved. This allows calls to `json_object()` and `json_array()` to be
1600    /// nested. The [`json()`] function can also be used to force strings to be recognized as JSON.
1601    ///
1602    /// This function requires at least SQLite 3.38 or newer
1603    ///
1604    /// # Examples
1605    ///
1606    /// ```rust
1607    /// # include!("../../doctest_setup.rs");
1608    /// #
1609    /// # fn main() {
1610    /// #     #[cfg(feature = "serde_json")]
1611    /// #     run_test().unwrap();
1612    /// # }
1613    /// #
1614    /// # #[cfg(feature = "serde_json")]
1615    /// # fn run_test() -> QueryResult<()> {
1616    /// #     use diesel::dsl::*;
1617    /// #     use diesel::sql_types::{Text, Integer};
1618    /// #     use serde_json::json;
1619    /// #
1620    /// #     let connection = &mut establish_connection();
1621    /// #     assert_version!(connection, 3, 38, 0);
1622    /// #
1623    /// let result = diesel::select(json_object_0()).get_result::<serde_json::Value>(connection)?;
1624    /// assert_eq!(json!({}), result);
1625    ///
1626    /// let result = diesel::select(json_object_1::<Text, Integer, _, _>("a", 2))
1627    ///     .get_result::<serde_json::Value>(connection)?;
1628    /// assert_eq!(json!({"a": 2}), result);
1629    ///
1630    /// let result = diesel::select(
1631    ///     json_object_2::<Text, Integer, Text, Text, _, _, _, _>("a", 2, "c", "{e:5}")
1632    /// )
1633    /// .get_result::<serde_json::Value>(connection)?;
1634    /// assert_eq!(json!({"a": 2, "c": "{e:5}"}), result);
1635    ///
1636    /// let result = diesel::select(
1637    ///     json_object_2::<Text, Integer, Text, Json, _, _, _, _>("a", 2, "c", json_object_1::<Text, Integer, _, _>("e", 5))
1638    /// )
1639    /// .get_result::<serde_json::Value>(connection)?;
1640    /// assert_eq!(json!({"a": 2, "c": {"e": 5}}), result);
1641    /// #
1642    /// # Ok(())
1643    /// # }
1644    /// ```
1645    #[cfg(feature = "__sqlite-shared")]
1646    #[variadic(2)]
1647    fn json_object<K: NotBlob<IsNull = is_nullable::NotNull>, V: NotBlob>(key: K, value: V)
1648    -> Json;
1649
1650    /// The `jsonb_object()` SQL function works just like the [`json_object()`](json_object_1())
1651    /// function except that the generated object is returned in SQLite's private binary JSONB
1652    /// format rather than in the standard RFC 8259 text format.
1653    ///
1654    /// This function requires at least SQLite 3.38 or newer
1655    ///
1656    /// # Examples
1657    ///
1658    /// ```rust
1659    /// # include!("../../doctest_setup.rs");
1660    /// #
1661    /// # fn main() {
1662    /// #     #[cfg(feature = "serde_json")]
1663    /// #     run_test().unwrap();
1664    /// # }
1665    /// #
1666    /// # #[cfg(feature = "serde_json")]
1667    /// # fn run_test() -> QueryResult<()> {
1668    /// #     use diesel::dsl::*;
1669    /// #     use diesel::sql_types::{Text, Integer};
1670    /// #     use serde_json::json;
1671    /// #
1672    /// #     let connection = &mut establish_connection();
1673    /// #     assert_version!(connection, 3, 38, 0);
1674    /// #
1675    /// let result = diesel::select(jsonb_object_0()).get_result::<serde_json::Value>(connection)?;
1676    /// assert_eq!(json!({}), result);
1677    ///
1678    /// let result = diesel::select(jsonb_object_1::<Text, Integer, _, _>("a", 2))
1679    ///     .get_result::<serde_json::Value>(connection)?;
1680    /// assert_eq!(json!({"a": 2}), result);
1681    ///
1682    /// let result = diesel::select(
1683    ///     jsonb_object_2::<Text, Integer, Text, Text, _, _, _, _>("a", 2, "c", "{e:5}")
1684    /// )
1685    /// .get_result::<serde_json::Value>(connection)?;
1686    /// assert_eq!(json!({"a": 2, "c": "{e:5}"}), result);
1687    /// #
1688    /// # Ok(())
1689    /// # }
1690    /// ```
1691    #[cfg(feature = "__sqlite-shared")]
1692    #[variadic(2)]
1693    fn jsonb_object<K: NotBlob<IsNull = is_nullable::NotNull>, V: NotBlob>(
1694        key: K,
1695        value: V,
1696    ) -> Jsonb;
1697
1698    /// The json_group_object(NAME,VALUE) function returns a JSON object comprised of all NAME/VALUE pairs in
1699    /// the aggregation.
1700    ///
1701    /// A potential edge case in this function arises when `names` contains duplicate elements.
1702    /// In such case, the result will include all duplicates (e.g., `{"key": 1, "key": 2, "key": 3}`).
1703    /// Note that any duplicate entries in the resulting JSON will be removed during deserialization.
1704    ///
1705    /// This function requires at least SQLite 3.38 or newer
1706    ///
1707    /// ## Aggregate Function Expression
1708    ///
1709    /// This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details.
1710    ///
1711    /// # Examples
1712    ///
1713    /// ## Normal function usage
1714    ///
1715    /// ```rust
1716    /// # include!("../../doctest_setup.rs");
1717    /// #
1718    /// # fn main() {
1719    /// #     #[cfg(feature = "serde_json")]
1720    /// #     run_test().unwrap();
1721    /// # }
1722    /// #
1723    /// # #[cfg(feature = "serde_json")]
1724    /// # fn run_test() -> QueryResult<()> {
1725    /// #     use diesel::dsl::*;
1726    /// #     use diesel::sql_types::Text;
1727    /// #     use serde_json::json;
1728    /// #     use schema::animals::dsl::*;
1729    /// #
1730    /// #     let connection = &mut establish_connection();
1731    /// #     assert_version!(connection, 3, 38, 0);
1732    /// #
1733    /// let result = animals.select(json_group_object(species, name)).get_result::<serde_json::Value>(connection)?;
1734    /// assert_eq!(json!({"dog":"Jack","spider":null}), result);
1735    /// #
1736    /// # Ok(())
1737    /// # }
1738    /// ```
1739    ///
1740    /// ## Aggregate function expression
1741    ///
1742    /// ```rust
1743    /// # include!("../../doctest_setup.rs");
1744    /// #
1745    /// # fn main() {
1746    /// #     #[cfg(feature = "serde_json")]
1747    /// #     run_test().unwrap();
1748    /// # }
1749    /// #
1750    /// # #[cfg(feature = "serde_json")]
1751    /// # fn run_test() -> QueryResult<()> {
1752    /// #     use diesel::dsl::*;
1753    /// #     use diesel::sql_types::Text;
1754    /// #     use serde_json::json;
1755    /// #     use schema::animals::dsl::*;
1756    /// #
1757    /// #     let connection = &mut establish_connection();
1758    /// #
1759    /// #     let version = diesel::select(sql::<Text>("sqlite_version();"))
1760    /// #         .get_result::<String>(connection)?;
1761    /// #
1762    /// #     let version_components: Vec<&str> = version.split('.').collect();
1763    /// #     let major: u32 = version_components[0].parse().unwrap();
1764    /// #     let minor: u32 = version_components[1].parse().unwrap();
1765    /// #
1766    /// #     if major < 3 || minor < 38 {
1767    /// #         println!("SQLite version is too old, skipping the test.");
1768    /// #         return Ok(());
1769    /// #     }
1770    /// #
1771    /// let result = animals.select(json_group_object(species, name).aggregate_filter(legs.lt(8))).get_result::<serde_json::Value>(connection)?;
1772    /// assert_eq!(json!({"dog":"Jack"}), result);
1773    /// #
1774    /// # Ok(())
1775    /// # }
1776    /// ```
1777    ///
1778    /// # See also
1779    /// - [`jsonb_group_object`](jsonb_group_object()) will return data in JSONB format instead of JSON.
1780    /// - [`json_group_array`](json_group_array()) will return JSON array instead of object.
1781    #[cfg(feature = "__sqlite-shared")]
1782    #[aggregate]
1783    fn json_group_object<
1784        N: SqlType<IsNull = is_nullable::NotNull> + SingleValue,
1785        V: SqlType + SingleValue,
1786    >(
1787        names: N,
1788        values: V,
1789    ) -> Json;
1790
1791    /// The jsonb_group_object(NAME,VALUE) function returns a JSONB object comprised of all NAME/VALUE pairs in
1792    /// the aggregation.
1793    ///
1794    /// A potential edge case in this function arises when `names` contains duplicate elements.
1795    /// In such case, the result will include all duplicates (e.g., `{"key": 1, "key": 2, "key": 3}`).
1796    /// Note that any duplicate entries in the resulting JSONB will be removed during deserialization.
1797    ///
1798    /// This function requires at least SQLite 3.38 or newer
1799    ///
1800    /// ## Aggregate Function Expression
1801    ///
1802    /// This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details.
1803    ///
1804    /// # Examples
1805    ///
1806    /// ## Normal function usage
1807    ///
1808    /// ```rust
1809    /// # include!("../../doctest_setup.rs");
1810    /// #
1811    /// # fn main() {
1812    /// #     #[cfg(feature = "serde_json")]
1813    /// #     run_test().unwrap();
1814    /// # }
1815    /// #
1816    /// # #[cfg(feature = "serde_json")]
1817    /// # fn run_test() -> QueryResult<()> {
1818    /// #     use diesel::dsl::*;
1819    /// #     use diesel::sql_types::Text;
1820    /// #     use serde_json::json;
1821    /// #     use schema::animals::dsl::*;
1822    /// #
1823    /// #     let connection = &mut establish_connection();
1824    /// #     assert_version!(connection, 3, 38, 0);
1825    /// #
1826    /// let result = animals.select(jsonb_group_object(species, name)).get_result::<serde_json::Value>(connection)?;
1827    /// assert_eq!(json!({"dog":"Jack","spider":null}), result);
1828    /// #
1829    /// # Ok(())
1830    /// # }
1831    /// ```
1832    ///
1833    /// ## Aggregate function expression
1834    ///
1835    /// ```rust
1836    /// # include!("../../doctest_setup.rs");
1837    /// #
1838    /// # fn main() {
1839    /// #     #[cfg(feature = "serde_json")]
1840    /// #     run_test().unwrap();
1841    /// # }
1842    /// #
1843    /// # #[cfg(feature = "serde_json")]
1844    /// # fn run_test() -> QueryResult<()> {
1845    /// #     use diesel::dsl::*;
1846    /// #     use diesel::sql_types::Text;
1847    /// #     use serde_json::json;
1848    /// #     use schema::animals::dsl::*;
1849    /// #
1850    /// #     let connection = &mut establish_connection();
1851    /// #
1852    /// #     let version = diesel::select(sql::<Text>("sqlite_version();"))
1853    /// #         .get_result::<String>(connection)?;
1854    /// #
1855    /// #     let version_components: Vec<&str> = version.split('.').collect();
1856    /// #     let major: u32 = version_components[0].parse().unwrap();
1857    /// #     let minor: u32 = version_components[1].parse().unwrap();
1858    /// #
1859    /// #     if major < 3 || minor < 38 {
1860    /// #         println!("SQLite version is too old, skipping the test.");
1861    /// #         return Ok(());
1862    /// #     }
1863    /// #
1864    /// let result = animals.select(jsonb_group_object(species, name).aggregate_filter(legs.lt(8))).get_result::<serde_json::Value>(connection)?;
1865    /// assert_eq!(json!({"dog":"Jack"}), result);
1866    /// #
1867    /// # Ok(())
1868    /// # }
1869    /// ```
1870    ///
1871    /// # See also
1872    /// - [`json_group_object`](jsonb_group_array()) will return data in JSON format instead of JSONB.
1873    /// - [`jsonb_group_array`](jsonb_group_array()) will return JSONB array instead of object.
1874    #[cfg(feature = "__sqlite-shared")]
1875    #[aggregate]
1876    fn jsonb_group_object<
1877        N: SqlType<IsNull = is_nullable::NotNull> + SingleValue,
1878        V: SqlType + SingleValue,
1879    >(
1880        names: N,
1881        values: V,
1882    ) -> Jsonb;
1883
1884    /// The `json_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array
1885    /// that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this
1886    /// function.
1887    ///
1888    /// An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the
1889    /// argument is the output from another json function, then it is stored as JSON. This allows calls to
1890    /// `json_array()` and `json_object()` to be nested. The [`json()`] function can also be used to force
1891    /// strings to be recognized as JSON.
1892    ///
1893    /// This function requires at least SQLite 3.38 or newer
1894    ///
1895    /// # Examples
1896    ///
1897    /// ```rust
1898    /// # include!("../../doctest_setup.rs");
1899    /// #
1900    /// # fn main() {
1901    /// #     #[cfg(feature = "serde_json")]
1902    /// #     run_test().unwrap();
1903    /// # }
1904    /// #
1905    /// # #[cfg(feature = "serde_json")]
1906    /// # fn run_test() -> QueryResult<()> {
1907    /// #     use diesel::dsl::*;
1908    /// #     use diesel::sql_types::{Text, Double};
1909    /// #     use serde_json::json;
1910    /// #
1911    /// #     let connection = &mut establish_connection();
1912    /// #     assert_version!(connection, 3, 38, 0);
1913    /// #
1914    /// let result = diesel::select(json_array_0()).get_result::<serde_json::Value>(connection)?;
1915    /// assert_eq!(json!([]), result);
1916    ///
1917    /// let result = diesel::select(json_array_1::<Text, _>("abc"))
1918    ///     .get_result::<serde_json::Value>(connection)?;
1919    /// assert_eq!(json!(["abc"]), result);
1920    ///
1921    /// let result = diesel::select(json_array_2::<Text, Double, _, _>("abc", 3.1415))
1922    ///     .get_result::<serde_json::Value>(connection)?;
1923    /// assert_eq!(json!(["abc", 3.1415]), result);
1924    /// #
1925    /// # Ok(())
1926    /// # }
1927    /// ```
1928    #[cfg(feature = "__sqlite-shared")]
1929    #[variadic(1)]
1930    fn json_array<V: NotBlob>(value: V) -> Json;
1931
1932    /// The `jsonb_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array
1933    /// that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this
1934    /// function.
1935    ///
1936    /// An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the
1937    /// argument is the output from another json function, then it is stored as JSON. This allows calls to
1938    /// `jsonb_array()` and `jsonb_object()` to be nested. The [`json()`] function can also be used to force
1939    /// strings to be recognized as JSON.
1940    ///
1941    /// This function works just like the [`json_array()`](json_array_1()) function except that it returns the
1942    /// constructed JSON array in the SQLite's private JSONB format rather than in the standard RFC 8259 text
1943    /// format.
1944    ///
1945    /// This function requires at least SQLite 3.38 or newer
1946    ///
1947    /// # Examples
1948    ///
1949    /// ```rust
1950    /// # include!("../../doctest_setup.rs");
1951    /// #
1952    /// # fn main() {
1953    /// #     #[cfg(feature = "serde_json")]
1954    /// #     run_test().unwrap();
1955    /// # }
1956    /// #
1957    /// # #[cfg(feature = "serde_json")]
1958    /// # fn run_test() -> QueryResult<()> {
1959    /// #     use diesel::dsl::*;
1960    /// #     use diesel::sql_types::{Text, Double};
1961    /// #     use serde_json::json;
1962    /// #
1963    /// #     let connection = &mut establish_connection();
1964    /// #     assert_version!(connection, 3, 38, 0);
1965    /// #
1966    /// let result = diesel::select(jsonb_array_0()).get_result::<serde_json::Value>(connection)?;
1967    /// assert_eq!(json!([]), result);
1968    ///
1969    /// let result = diesel::select(jsonb_array_1::<Text, _>("abc"))
1970    ///     .get_result::<serde_json::Value>(connection)?;
1971    /// assert_eq!(json!(["abc"]), result);
1972    ///
1973    /// let result = diesel::select(jsonb_array_2::<Text, Double, _, _>("abc", 3.1415))
1974    ///     .get_result::<serde_json::Value>(connection)?;
1975    /// assert_eq!(json!(["abc", 3.1415]), result);
1976    /// #
1977    /// # Ok(())
1978    /// # }
1979    /// ```
1980    #[cfg(feature = "__sqlite-shared")]
1981    #[variadic(1)]
1982    fn jsonb_array<V: NotBlob>(value: V) -> Jsonb;
1983
1984    /// The `json_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by
1985    /// zero or more path arguments. The `json_remove(X,P,...)` function returns a copy of the X parameter
1986    /// with all the elements identified by path arguments removed. Paths that select elements not found in X
1987    /// are silently ignored.
1988    ///
1989    /// Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path
1990    /// search for subsequent arguments.
1991    ///
1992    /// If the `json_remove(X)` function is called with no path arguments, then it returns the input X
1993    /// reformatted, with excess whitespace removed.
1994    ///
1995    /// The `json_remove()` function throws an error if any of the path arguments is not a well-formed path.
1996    ///
1997    /// This function requires at least SQLite 3.38 or newer
1998    ///
1999    /// # Examples
2000    ///
2001    /// ```rust
2002    /// # include!("../../doctest_setup.rs");
2003    /// #
2004    /// # fn main() {
2005    /// #     #[cfg(feature = "serde_json")]
2006    /// #     run_test().unwrap();
2007    /// # }
2008    /// #
2009    /// # #[cfg(feature = "serde_json")]
2010    /// # fn run_test() -> QueryResult<()> {
2011    /// #     use diesel::dsl::*;
2012    /// #     use diesel::sql_types::{Json, Text};
2013    /// #     use serde_json::json;
2014    /// #
2015    /// #     let connection = &mut establish_connection();
2016    /// #     assert_version!(connection, 3, 38, 0);
2017    /// #
2018    /// let json = json!(['a', 'b', 'c', 'd']);
2019    /// let result = diesel::select(json_remove_0::<Json, _>(json))
2020    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2021    /// assert_eq!(Some(json!(['a', 'b', 'c', 'd'])), result);
2022    ///
2023    /// // Values are removed sequentially from left to right.
2024    /// let json = json!(['a', 'b', 'c', 'd']);
2025    /// let result = diesel::select(json_remove_2::<Json, _, _, _>(json, "$[0]", "$[2]"))
2026    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2027    /// assert_eq!(Some(json!(['b', 'c'])), result);
2028    ///
2029    /// let json = json!({"a": 10, "b": 20});
2030    /// let result = diesel::select(json_remove_1::<Json, _, _>(json, "$.a"))
2031    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2032    /// assert_eq!(Some(json!({"b": 20})), result);
2033    ///
2034    /// // Paths that select not existing elements are silently ignored.
2035    /// let json = json!({"a": 10, "b": 20});
2036    /// let result = diesel::select(json_remove_1::<Json, _, _>(json, "$.c"))
2037    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2038    /// assert_eq!(Some(json!({"a": 10, "b": 20})), result);
2039    ///
2040    /// let json = json!({"a": 10, "b": 20});
2041    /// let result = diesel::select(json_remove_1::<Json, _, _>(json, "$"))
2042    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2043    /// assert_eq!(None, result);
2044    ///
2045    /// #
2046    /// # Ok(())
2047    /// # }
2048    /// ```
2049    #[cfg(feature = "__sqlite-shared")]
2050    #[variadic(1)]
2051    fn json_remove<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
2052        json: J,
2053        path: Text,
2054    ) -> Nullable<Json>;
2055
2056    /// The `jsonb_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by
2057    /// zero or more path arguments. The `jsonb_remove(X,P,...)` function returns a copy of the X parameter
2058    /// with all the elements identified by path arguments removed. Paths that select elements not found in X
2059    /// are silently ignored.
2060    ///
2061    /// Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path
2062    /// search for subsequent arguments.
2063    ///
2064    /// If the `jsonb_remove(X)` function is called with no path arguments, then it returns the input X
2065    /// reformatted, with excess whitespace removed.
2066    ///
2067    /// The `jsonb_remove()` function throws an error if any of the path arguments is not a well-formed path.
2068    ///
2069    /// This function returns value in a binary JSONB format.
2070    ///
2071    /// This function requires at least SQLite 3.38 or newer
2072    ///
2073    /// # Examples
2074    ///
2075    /// ```rust
2076    /// # include!("../../doctest_setup.rs");
2077    /// #
2078    /// # fn main() {
2079    /// #     #[cfg(feature = "serde_json")]
2080    /// #     run_test().unwrap();
2081    /// # }
2082    /// #
2083    /// # #[cfg(feature = "serde_json")]
2084    /// # fn run_test() -> QueryResult<()> {
2085    /// #     use diesel::dsl::*;
2086    /// #     use diesel::sql_types::{Jsonb, Text};
2087    /// #     use serde_json::json;
2088    /// #
2089    /// #     let connection = &mut establish_connection();
2090    /// #     assert_version!(connection, 3, 38, 0);
2091    /// #
2092    /// let json = json!(['a', 'b', 'c', 'd']);
2093    /// let result = diesel::select(jsonb_remove_0::<Jsonb, _>(json))
2094    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2095    /// assert_eq!(Some(json!(['a', 'b', 'c', 'd'])), result);
2096    ///
2097    /// // Values are removed sequentially from left to right.
2098    /// let json = json!(['a', 'b', 'c', 'd']);
2099    /// let result = diesel::select(jsonb_remove_2::<Jsonb, _, _, _>(json, "$[0]", "$[2]"))
2100    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2101    /// assert_eq!(Some(json!(['b', 'c'])), result);
2102    ///
2103    /// let json = json!({"a": 10, "b": 20});
2104    /// let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, "$.a"))
2105    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2106    /// assert_eq!(Some(json!({"b": 20})), result);
2107    ///
2108    /// // Paths that select not existing elements are silently ignored.
2109    /// let json = json!({"a": 10, "b": 20});
2110    /// let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, "$.c"))
2111    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2112    /// assert_eq!(Some(json!({"a": 10, "b": 20})), result);
2113    ///
2114    /// let json = json!({"a": 10, "b": 20});
2115    /// let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, "$"))
2116    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2117    /// assert_eq!(None, result);
2118    ///
2119    /// #
2120    /// # Ok(())
2121    /// # }
2122    /// ```
2123    #[cfg(feature = "__sqlite-shared")]
2124    #[variadic(1)]
2125    fn jsonb_remove<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
2126        json: J,
2127        path: Text,
2128    ) -> Nullable<Jsonb>;
2129
2130    /// The `json_insert(X,P,V,...)` SQL function takes a single JSON value as its first argument
2131    /// followed by zero or more pairs of path and value arguments. It returns a copy of the X
2132    /// argument with the values V inserted at the paths P, but only where nothing already exists at
2133    /// the path. Paths that already select an element of X are left unchanged.
2134    ///
2135    /// The path/value pairs are applied sequentially from left to right.
2136    ///
2137    /// A path that ends in `[#]` appends the value to an existing array.
2138    ///
2139    /// If the `json_insert(X)` function is called with no path/value pairs, then it returns the
2140    /// input X reformatted, with excess whitespace removed.
2141    ///
2142    /// The `json_insert()` function throws an error if any of the path arguments is not a
2143    /// well-formed path.
2144    ///
2145    /// This function requires at least SQLite 3.38 or newer
2146    ///
2147    /// # Examples
2148    ///
2149    /// ```rust
2150    /// # include!("../../doctest_setup.rs");
2151    /// #
2152    /// # fn main() {
2153    /// #     #[cfg(feature = "serde_json")]
2154    /// #     run_test().unwrap();
2155    /// # }
2156    /// #
2157    /// # #[cfg(feature = "serde_json")]
2158    /// # fn run_test() -> QueryResult<()> {
2159    /// #     use diesel::dsl::*;
2160    /// #     use diesel::sql_types::{Integer, Json, Text, Nullable};
2161    /// #     use serde_json::json;
2162    /// #
2163    /// #     let connection = &mut establish_connection();
2164    /// #     assert_version!(connection, 3, 38, 0);
2165    /// #
2166    /// let json = json!({"a": 1, "c": 3});
2167    /// let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, "$.b", 2))
2168    ///     .get_result::<serde_json::Value>(connection)?;
2169    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2170    ///
2171    /// // A path that already exists is left unchanged.
2172    /// let json = json!({"a": 1});
2173    /// let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, "$.a", 99))
2174    ///     .get_result::<serde_json::Value>(connection)?;
2175    /// assert_eq!(json!({"a": 1}), result);
2176    ///
2177    /// // A path ending in "[#]" appends to an array.
2178    /// let json = json!(['a', 'b', 'c']);
2179    /// let result = diesel::select(json_insert_1::<Json, Text, _, _, _>(json, "$[#]", "d"))
2180    ///     .get_result::<serde_json::Value>(connection)?;
2181    /// assert_eq!(json!(['a', 'b', 'c', 'd']), result);
2182    ///
2183    /// let json = json!({"a": 1});
2184    /// let result = diesel::select(
2185    ///     json_insert_2::<Json, Integer, Integer, _, _, _, _, _>(json, "$.b", 2, "$.c", 3),
2186    /// )
2187    /// .get_result::<serde_json::Value>(connection)?;
2188    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2189    ///
2190    /// let json = json!({"a": 1});
2191    /// let result = diesel::select(json_insert_0::<Json, _>(json))
2192    ///     .get_result::<serde_json::Value>(connection)?;
2193    /// assert_eq!(json!({"a": 1}), result);
2194    ///
2195    /// let result = diesel::select(json_insert_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, "$.b", 1))
2196    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2197    /// assert_eq!(result, None);
2198    /// #
2199    /// # Ok(())
2200    /// # }
2201    /// ```
2202    #[cfg(feature = "__sqlite-shared")]
2203    #[variadic(2)]
2204    fn json_insert<
2205        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Json> + SingleValue,
2206        V: NotBlob,
2207    >(
2208        json: J,
2209        path: Text,
2210        value: V,
2211    ) -> J::Out;
2212
2213    /// The `jsonb_insert(X,P,V,...)` SQL function works just like the [`json_insert()`](json_insert_1())
2214    /// function except that the result is returned in SQLite's private binary JSONB format rather than
2215    /// in the standard RFC 8259 text format.
2216    ///
2217    /// This function requires at least SQLite 3.38 or newer
2218    ///
2219    /// # Examples
2220    ///
2221    /// ```rust
2222    /// # include!("../../doctest_setup.rs");
2223    /// #
2224    /// # fn main() {
2225    /// #     #[cfg(feature = "serde_json")]
2226    /// #     run_test().unwrap();
2227    /// # }
2228    /// #
2229    /// # #[cfg(feature = "serde_json")]
2230    /// # fn run_test() -> QueryResult<()> {
2231    /// #     use diesel::dsl::*;
2232    /// #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};
2233    /// #     use serde_json::json;
2234    /// #
2235    /// #     let connection = &mut establish_connection();
2236    /// #     assert_version!(connection, 3, 38, 0);
2237    /// #
2238    /// let json = json!({"a": 1, "c": 3});
2239    /// let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, "$.b", 2))
2240    ///     .get_result::<serde_json::Value>(connection)?;
2241    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2242    ///
2243    /// // A path that already exists is left unchanged.
2244    /// let json = json!({"a": 1});
2245    /// let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, "$.a", 99))
2246    ///     .get_result::<serde_json::Value>(connection)?;
2247    /// assert_eq!(json!({"a": 1}), result);
2248    ///
2249    /// // A path ending in "[#]" appends to an array.
2250    /// let json = json!(['a', 'b', 'c']);
2251    /// let result = diesel::select(jsonb_insert_1::<Jsonb, Text, _, _, _>(json, "$[#]", "d"))
2252    ///     .get_result::<serde_json::Value>(connection)?;
2253    /// assert_eq!(json!(['a', 'b', 'c', 'd']), result);
2254    ///
2255    /// let json = json!({"a": 1});
2256    /// let result = diesel::select(
2257    ///     jsonb_insert_2::<Jsonb, Integer, Integer, _, _, _, _, _>(json, "$.b", 2, "$.c", 3),
2258    /// )
2259    /// .get_result::<serde_json::Value>(connection)?;
2260    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2261    ///
2262    /// let json = json!({"a": 1});
2263    /// let result = diesel::select(jsonb_insert_0::<Jsonb, _>(json))
2264    ///     .get_result::<serde_json::Value>(connection)?;
2265    /// assert_eq!(json!({"a": 1}), result);
2266    ///
2267    /// let result = diesel::select(jsonb_insert_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, "$.b", 1))
2268    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2269    /// assert_eq!(result, None);
2270    /// #
2271    /// # Ok(())
2272    /// # }
2273    /// ```
2274    #[cfg(feature = "__sqlite-shared")]
2275    #[variadic(2)]
2276    fn jsonb_insert<
2277        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Jsonb> + SingleValue,
2278        V: NotBlob,
2279    >(
2280        json: J,
2281        path: Text,
2282        value: V,
2283    ) -> J::Out;
2284
2285    /// The `json_replace(X,P,V,...)` SQL function takes a single JSON value as its first argument
2286    /// followed by zero or more pairs of path and value arguments. It returns a copy of the X
2287    /// argument with values V substituted at the paths P, but only where something already exists
2288    /// at the path. Paths that select elements not found in X are silently ignored.
2289    ///
2290    /// The path/value pairs are applied sequentially from left to right.
2291    ///
2292    /// If the `json_replace(X)` function is called with no path/value pairs, then it returns the
2293    /// input X reformatted, with excess whitespace removed.
2294    ///
2295    /// The `json_replace()` function throws an error if any of the path arguments is not a
2296    /// well-formed path.
2297    ///
2298    /// This function requires at least SQLite 3.38 or newer
2299    ///
2300    /// # Examples
2301    ///
2302    /// ```rust
2303    /// # include!("../../doctest_setup.rs");
2304    /// #
2305    /// # fn main() {
2306    /// #     #[cfg(feature = "serde_json")]
2307    /// #     run_test().unwrap();
2308    /// # }
2309    /// #
2310    /// # #[cfg(feature = "serde_json")]
2311    /// # fn run_test() -> QueryResult<()> {
2312    /// #     use diesel::dsl::*;
2313    /// #     use diesel::sql_types::{Integer, Json, Text, Nullable};
2314    /// #     use serde_json::json;
2315    /// #
2316    /// #     let connection = &mut establish_connection();
2317    /// #     assert_version!(connection, 3, 38, 0);
2318    /// #
2319    /// let json = json!({"a": 1, "b": 2});
2320    /// let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, "$.a", 99))
2321    ///     .get_result::<serde_json::Value>(connection)?;
2322    /// assert_eq!(json!({"a": 99, "b": 2}), result);
2323    ///
2324    /// // A path that does not exist is silently ignored.
2325    /// let json = json!({"a": 1});
2326    /// let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, "$.b", 2))
2327    ///     .get_result::<serde_json::Value>(connection)?;
2328    /// assert_eq!(json!({"a": 1}), result);
2329    ///
2330    /// let json = json!({"a": 1, "b": 2});
2331    /// let result = diesel::select(
2332    ///     json_replace_2::<Json, Integer, Text, _, _, _, _, _>(json, "$.a", 99, "$.b", "x"),
2333    /// )
2334    /// .get_result::<serde_json::Value>(connection)?;
2335    /// assert_eq!(json!({"a": 99, "b": "x"}), result);
2336    ///
2337    /// let json = json!({"a": 1});
2338    /// let result = diesel::select(json_replace_0::<Json, _>(json))
2339    ///     .get_result::<serde_json::Value>(connection)?;
2340    /// assert_eq!(json!({"a": 1}), result);
2341    ///
2342    /// let result = diesel::select(json_replace_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, "$.a", 1))
2343    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2344    /// assert_eq!(result, None);
2345    /// #
2346    /// # Ok(())
2347    /// # }
2348    /// ```
2349    #[cfg(feature = "__sqlite-shared")]
2350    #[variadic(2)]
2351    fn json_replace<
2352        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Json> + SingleValue,
2353        V: NotBlob,
2354    >(
2355        json: J,
2356        path: Text,
2357        value: V,
2358    ) -> J::Out;
2359
2360    /// The `jsonb_replace(X,P,V,...)` SQL function works just like the [`json_replace()`](json_replace_1())
2361    /// function except that the result is returned in SQLite's private binary JSONB format rather than
2362    /// in the standard RFC 8259 text format.
2363    ///
2364    /// This function requires at least SQLite 3.38 or newer
2365    ///
2366    /// # Examples
2367    ///
2368    /// ```rust
2369    /// # include!("../../doctest_setup.rs");
2370    /// #
2371    /// # fn main() {
2372    /// #     #[cfg(feature = "serde_json")]
2373    /// #     run_test().unwrap();
2374    /// # }
2375    /// #
2376    /// # #[cfg(feature = "serde_json")]
2377    /// # fn run_test() -> QueryResult<()> {
2378    /// #     use diesel::dsl::*;
2379    /// #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};
2380    /// #     use serde_json::json;
2381    /// #
2382    /// #     let connection = &mut establish_connection();
2383    /// #     assert_version!(connection, 3, 38, 0);
2384    /// #
2385    /// let json = json!({"a": 1, "b": 2});
2386    /// let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, "$.a", 99))
2387    ///     .get_result::<serde_json::Value>(connection)?;
2388    /// assert_eq!(json!({"a": 99, "b": 2}), result);
2389    ///
2390    /// // A path that does not exist is silently ignored.
2391    /// let json = json!({"a": 1});
2392    /// let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, "$.b", 2))
2393    ///     .get_result::<serde_json::Value>(connection)?;
2394    /// assert_eq!(json!({"a": 1}), result);
2395    ///
2396    /// let json = json!({"a": 1});
2397    /// let result = diesel::select(jsonb_replace_0::<Jsonb, _>(json))
2398    ///     .get_result::<serde_json::Value>(connection)?;
2399    /// assert_eq!(json!({"a": 1}), result);
2400    ///
2401    /// let result = diesel::select(jsonb_replace_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, "$.a", 1))
2402    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2403    /// assert_eq!(result, None);
2404    /// #
2405    /// # Ok(())
2406    /// # }
2407    /// ```
2408    #[cfg(feature = "__sqlite-shared")]
2409    #[variadic(2)]
2410    fn jsonb_replace<
2411        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Jsonb> + SingleValue,
2412        V: NotBlob,
2413    >(
2414        json: J,
2415        path: Text,
2416        value: V,
2417    ) -> J::Out;
2418
2419    /// The `json_set(X,P,V,...)` SQL function takes a single JSON value as its first argument
2420    /// followed by zero or more pairs of path and value arguments. It returns a copy of the X
2421    /// argument with values V inserted or replaced at the paths P. Unlike [`json_replace()`](json_replace_1()),
2422    /// `json_set()` also inserts new values where the path does not already exist.
2423    ///
2424    /// The path/value pairs are applied sequentially from left to right.
2425    ///
2426    /// A path that ends in `[#]` appends the value to an existing array.
2427    ///
2428    /// If the `json_set(X)` function is called with no path/value pairs, then it returns the
2429    /// input X reformatted, with excess whitespace removed.
2430    ///
2431    /// The `json_set()` function throws an error if any of the path arguments is not a
2432    /// well-formed path.
2433    ///
2434    /// This function requires at least SQLite 3.38 or newer
2435    ///
2436    /// # Examples
2437    ///
2438    /// ```rust
2439    /// # include!("../../doctest_setup.rs");
2440    /// #
2441    /// # fn main() {
2442    /// #     #[cfg(feature = "serde_json")]
2443    /// #     run_test().unwrap();
2444    /// # }
2445    /// #
2446    /// # #[cfg(feature = "serde_json")]
2447    /// # fn run_test() -> QueryResult<()> {
2448    /// #     use diesel::dsl::*;
2449    /// #     use diesel::sql_types::{Integer, Json, Text, Nullable};
2450    /// #     use serde_json::json;
2451    /// #
2452    /// #     let connection = &mut establish_connection();
2453    /// #     assert_version!(connection, 3, 38, 0);
2454    /// #
2455    /// let json = json!({"a": 1});
2456    /// let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, "$.b", 2))
2457    ///     .get_result::<serde_json::Value>(connection)?;
2458    /// assert_eq!(json!({"a": 1, "b": 2}), result);
2459    ///
2460    /// // Existing values are replaced.
2461    /// let json = json!({"a": 1});
2462    /// let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, "$.a", 99))
2463    ///     .get_result::<serde_json::Value>(connection)?;
2464    /// assert_eq!(json!({"a": 99}), result);
2465    ///
2466    /// // A path ending in "[#]" appends to an array.
2467    /// let json = json!(['a', 'b', 'c']);
2468    /// let result = diesel::select(json_set_1::<Json, Text, _, _, _>(json, "$[#]", "d"))
2469    ///     .get_result::<serde_json::Value>(connection)?;
2470    /// assert_eq!(json!(['a', 'b', 'c', 'd']), result);
2471    ///
2472    /// let json = json!({"a": 1});
2473    /// let result = diesel::select(
2474    ///     json_set_2::<Json, Integer, Integer, _, _, _, _, _>(json, "$.b", 2, "$.c", 3),
2475    /// )
2476    /// .get_result::<serde_json::Value>(connection)?;
2477    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2478    ///
2479    /// let json = json!({"a": 1});
2480    /// let result = diesel::select(json_set_0::<Json, _>(json))
2481    ///     .get_result::<serde_json::Value>(connection)?;
2482    /// assert_eq!(json!({"a": 1}), result);
2483    ///
2484    /// let result = diesel::select(json_set_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, "$.b", 1))
2485    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2486    /// assert_eq!(result, None);
2487    /// #
2488    /// # Ok(())
2489    /// # }
2490    /// ```
2491    #[cfg(feature = "__sqlite-shared")]
2492    #[variadic(2)]
2493    fn json_set<
2494        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Json> + SingleValue,
2495        V: NotBlob,
2496    >(
2497        json: J,
2498        path: Text,
2499        value: V,
2500    ) -> J::Out;
2501
2502    /// The `jsonb_set(X,P,V,...)` SQL function works just like the [`json_set()`](json_set_1())
2503    /// function except that the result is returned in SQLite's private binary JSONB format rather than
2504    /// in the standard RFC 8259 text format.
2505    ///
2506    /// This function requires at least SQLite 3.38 or newer
2507    ///
2508    /// # Examples
2509    ///
2510    /// ```rust
2511    /// # include!("../../doctest_setup.rs");
2512    /// #
2513    /// # fn main() {
2514    /// #     #[cfg(feature = "serde_json")]
2515    /// #     run_test().unwrap();
2516    /// # }
2517    /// #
2518    /// # #[cfg(feature = "serde_json")]
2519    /// # fn run_test() -> QueryResult<()> {
2520    /// #     use diesel::dsl::*;
2521    /// #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};
2522    /// #     use serde_json::json;
2523    /// #
2524    /// #     let connection = &mut establish_connection();
2525    /// #     assert_version!(connection, 3, 38, 0);
2526    /// #
2527    /// let json = json!({"a": 1});
2528    /// let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, "$.b", 2))
2529    ///     .get_result::<serde_json::Value>(connection)?;
2530    /// assert_eq!(json!({"a": 1, "b": 2}), result);
2531    ///
2532    /// // Existing values are replaced.
2533    /// let json = json!({"a": 1});
2534    /// let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, "$.a", 99))
2535    ///     .get_result::<serde_json::Value>(connection)?;
2536    /// assert_eq!(json!({"a": 99}), result);
2537    ///
2538    /// // A path ending in "[#]" appends to an array.
2539    /// let json = json!(['a', 'b', 'c']);
2540    /// let result = diesel::select(jsonb_set_1::<Jsonb, Text, _, _, _>(json, "$[#]", "d"))
2541    ///     .get_result::<serde_json::Value>(connection)?;
2542    /// assert_eq!(json!(['a', 'b', 'c', 'd']), result);
2543    ///
2544    /// let json = json!({"a": 1});
2545    /// let result = diesel::select(jsonb_set_0::<Jsonb, _>(json))
2546    ///     .get_result::<serde_json::Value>(connection)?;
2547    /// assert_eq!(json!({"a": 1}), result);
2548    ///
2549    /// let result = diesel::select(jsonb_set_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, "$.b", 1))
2550    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2551    /// assert_eq!(result, None);
2552    /// #
2553    /// # Ok(())
2554    /// # }
2555    /// ```
2556    #[cfg(feature = "__sqlite-shared")]
2557    #[variadic(2)]
2558    fn jsonb_set<
2559        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Jsonb> + SingleValue,
2560        V: NotBlob,
2561    >(
2562        json: J,
2563        path: Text,
2564        value: V,
2565    ) -> J::Out;
2566
2567    /// Applies an RFC 7396 MergePatch `patch` to the input JSON `target` and
2568    /// returns the patched JSON value.
2569    ///
2570    /// MergePatch can add, modify, or delete elements of a JSON object. Arrays are
2571    /// treated as atomic values: they can only be inserted, replaced, or deleted as a
2572    /// whole, not modified element-wise.
2573    ///
2574    /// # Examples
2575    ///
2576    /// ```rust
2577    /// # include!("../../doctest_setup.rs");
2578    /// #
2579    /// # fn main() {
2580    /// #     #[cfg(feature = "serde_json")]
2581    /// #     run_test().unwrap();
2582    /// # }
2583    /// #
2584    /// # #[cfg(feature = "serde_json")]
2585    /// # fn run_test() -> QueryResult<()> {
2586    /// #     use diesel::dsl::json_patch;
2587    /// #     use serde_json::{json, Value};
2588    /// #     use diesel::sql_types::{Json, Nullable};
2589    /// #     let connection = &mut establish_connection();
2590    ///
2591    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2592    ///     json!( {"a":1,"b":2} ),
2593    ///     json!( {"c":3,"d":4} ),
2594    /// ))
2595    /// .get_result::<Value>(connection)?;
2596    /// assert_eq!(json!({"a":1,"b":2,"c":3,"d":4}), result);
2597    ///
2598    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2599    ///     json!( {"a":[1,2],"b":2} ),
2600    ///     json!( {"a":9} ),
2601    /// ))
2602    /// .get_result::<Value>(connection)?;
2603    /// assert_eq!(json!({"a":9,"b":2}), result);
2604    ///
2605    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2606    ///     json!( {"a":[1,2],"b":2} ),
2607    ///     json!( {"a":null} ),
2608    /// ))
2609    /// .get_result::<Value>(connection)?;
2610    /// assert_eq!(json!({"b":2}), result);
2611    ///
2612    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2613    ///     json!( {"a":1,"b":2} ),
2614    ///     json!( {"a":9,"b":null,"c":8} ),
2615    /// ))
2616    /// .get_result::<Value>(connection)?;
2617    /// assert_eq!(json!({"a":9,"c":8}), result);
2618    ///
2619    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2620    ///     json!( {"a":{"x":1,"y":2},"b":3} ),
2621    ///     json!( {"a":{"y":9},"c":8} ),
2622    /// ))
2623    /// .get_result::<Value>(connection)?;
2624    /// assert_eq!(
2625    ///     json!({"a":{"x":1,"y":9},"b":3,"c":8}),
2626    ///     result
2627    /// );
2628    ///
2629    /// // Nullable input yields nullable output
2630    /// let result = diesel::select(json_patch::<Nullable<Json>, Json, _, _>(
2631    ///     None::<Value>,
2632    ///     json!({}),
2633    /// ))
2634    /// .get_result::<Option<Value>>(connection)?;
2635    /// assert!(result.is_none());
2636    ///
2637    /// #     Ok(())
2638    /// # }
2639    /// ```
2640    #[cfg(feature = "__sqlite-shared")]
2641    fn json_patch<
2642        T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
2643        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue + CombinedNullableValue<T, Json>,
2644    >(
2645        target: T,
2646        patch: P,
2647    ) -> P::Out;
2648
2649    /// Applies an RFC 7396 MergePatch `patch` to the input JSON `target` and
2650    /// returns the patched JSON value in SQLite's binary JSONB format.
2651    ///
2652    /// See [`json_patch`](json_patch()) for details about the MergePatch semantics.
2653    ///
2654    /// # Examples
2655    ///
2656    /// ```rust
2657    /// # include!("../../doctest_setup.rs");
2658    /// #
2659    /// # fn main() {
2660    /// #     #[cfg(feature = "serde_json")]
2661    /// #     run_test().unwrap();
2662    /// # }
2663    /// #
2664    /// # #[cfg(feature = "serde_json")]
2665    /// # fn run_test() -> QueryResult<()> {
2666    /// #     use diesel::dsl::jsonb_patch;
2667    /// #     use serde_json::{json, Value};
2668    /// #     use diesel::sql_types::{Jsonb, Nullable};
2669    /// #     let connection = &mut establish_connection();
2670    /// #     assert_version!(connection, 3, 45, 0);
2671    ///
2672    /// let result = diesel::select(jsonb_patch::<Jsonb, Jsonb, _, _>(
2673    ///     json!( {"a":1,"b":2} ),
2674    ///     json!( {"c":3,"d":4} ),
2675    /// ))
2676    /// .get_result::<Value>(connection)?;
2677    /// assert_eq!(json!({"a":1,"b":2,"c":3,"d":4}), result);
2678    ///
2679    /// // Nullable input yields nullable output
2680    /// let result = diesel::select(jsonb_patch::<Nullable<Jsonb>, Jsonb, _, _>(
2681    ///     None::<Value>,
2682    ///     json!({}),
2683    /// ))
2684    /// .get_result::<Option<Value>>(connection)?;
2685    /// assert!(result.is_none());
2686    ///
2687    /// #     Ok(())
2688    /// # }
2689    /// ```
2690    #[cfg(feature = "__sqlite-shared")]
2691    fn jsonb_patch<
2692        T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
2693        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue + CombinedNullableValue<T, Jsonb>,
2694    >(
2695        target: T,
2696        patch: P,
2697    ) -> P::Out;
2698}
2699
2700pub(super) mod return_type_helpers_reexported {
2701    #[allow(unused_imports)]
2702    #[doc(inline)]
2703    pub use super::return_type_helpers::*;
2704}