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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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.45 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer."]
#[doc = ""]
#[doc = " # Example"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 = " This function requires at least SQLite 3.45 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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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 serde_json::json;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 45, 0);"]
#[doc = " #"]
#[doc = " let result = animals"]
#[doc = "     .select(jsonb_group_array(species))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([\"dog\", \"spider\"]));"]
#[doc = ""]
#[doc = " let result = animals"]
#[doc = "     .select(jsonb_group_array(legs))"]
#[doc = "     .get_result::<serde_json::Value>(connection)?;"]
#[doc = " assert_eq!(result, json!([4, 8]));"]
#[doc = ""]
#[doc = " let result = animals"]
#[doc = "     .select(jsonb_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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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 serde_json::json;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 45, 0);"]
#[doc = " #"]
#[doc = " let result = animals"]
#[doc =
"     .select(jsonb_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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self { *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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self { *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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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).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) -> Self {
            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.45 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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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 serde_json::json;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 45, 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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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 serde_json::json;"]
#[doc = " #     use schema::animals::dsl::*;"]
#[doc = " #"]
#[doc = " #     let connection = &mut establish_connection();"]
#[doc = " #     assert_version!(connection, 3, 45, 0);"]
#[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`](json_group_object()) 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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self { *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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self { *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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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, 45, 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) -> Self {
            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 =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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 = " This function requires at least SQLite 3.45 or newer"]
#[doc = ""]
#[doc = " # Examples"]
#[doc = ""]
#[doc = " ```rust"]
#[doc = " # include!(\"../../doctest_setup.rs\");"]
#[doc = " #"]
#[doc =
" # // Reading the query result requires reading memory allocated by the"]
#[doc =
" # // native sqlite library, which miri cannot track provenance for."]
#[doc = " # #[cfg(miri)]"]
#[doc = " # fn main() {}"]
#[doc = " # #[cfg(not(miri))]"]
#[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) -> Self {
            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    /// # // Reading the query result requires reading memory allocated by the
28    /// # // native sqlite library, which miri cannot track provenance for.
29    /// # #[cfg(miri)]
30    /// # fn main() {}
31    /// # #[cfg(not(miri))]
32    /// # fn main() {
33    /// #     #[cfg(feature = "serde_json")]
34    /// #     run_test().unwrap();
35    /// # }
36    /// #
37    /// # #[cfg(feature = "serde_json")]
38    /// # fn run_test() -> QueryResult<()> {
39    /// #     use diesel::dsl::json;
40    /// #     use serde_json::{json, Value};
41    /// #     use diesel::sql_types::{Text, Nullable};
42    /// #     let connection = &mut establish_connection();
43    ///
44    /// let result = diesel::select(json::<Text, _>(r#"{"a": "b", "c": 1}"#))
45    ///     .get_result::<Value>(connection)?;
46    ///
47    /// assert_eq!(json!({"a":"b","c":1}), result);
48    ///
49    /// let result = diesel::select(json::<Text, _>(r#"{ "this" : "is", "a": [ "test" ] }"#))
50    ///     .get_result::<Value>(connection)?;
51    ///
52    /// assert_eq!(json!({"a":["test"],"this":"is"}), result);
53    ///
54    /// let result = diesel::select(json::<Nullable<Text>, _>(None::<&str>))
55    ///     .get_result::<Option<Value>>(connection)?;
56    ///
57    /// assert!(result.is_none());
58    ///
59    /// #     Ok(())
60    /// # }
61    /// ```
62    fn json<E: TextOrNullableText + MaybeNullableValue<Json>>(e: E) -> E::Out;
63
64    /// The jsonb(X) function returns the binary JSONB representation of the JSON provided as argument X.
65    ///
66    /// This function requires at least SQLite 3.45 or newer
67    ///
68    /// # Example
69    ///
70    /// ```rust
71    /// # include!("../../doctest_setup.rs");
72    /// #
73    /// # // Reading the query result requires reading memory allocated by the
74    /// # // native sqlite library, which miri cannot track provenance for.
75    /// # #[cfg(miri)]
76    /// # fn main() {}
77    /// # #[cfg(not(miri))]
78    /// # fn main() {
79    /// #     #[cfg(feature = "serde_json")]
80    /// #     run_test().unwrap();
81    /// # }
82    /// #
83    /// # #[cfg(feature = "serde_json")]
84    /// # fn run_test() -> QueryResult<()> {
85    /// #     use diesel::dsl::{sql, jsonb};
86    /// #     use serde_json::{json, Value};
87    /// #     use diesel::sql_types::{Text, Binary, Nullable};
88    /// #     let connection = &mut establish_connection();
89    /// #     assert_version!(connection, 3, 45, 0);
90    ///
91    /// let result = diesel::select(jsonb::<Binary, _>(br#"{"a": "b", "c": 1}"#))
92    ///     .get_result::<Value>(connection)?;
93    ///
94    /// assert_eq!(json!({"a": "b", "c": 1}), result);
95    ///
96    /// let result = diesel::select(jsonb::<Binary, _>(br#"{"this":"is","a":["test"]}"#))
97    ///     .get_result::<Value>(connection)?;
98    ///
99    /// assert_eq!(json!({"this":"is","a":["test"]}), result);
100    ///
101    /// let result = diesel::select(jsonb::<Nullable<Binary>, _>(None::<Vec<u8>>))
102    ///     .get_result::<Option<Value>>(connection)?;
103    ///
104    /// assert!(result.is_none());
105    ///
106    /// #     Ok(())
107    /// # }
108    /// ```
109    fn jsonb<E: BinaryOrNullableBinary + MaybeNullableValue<Jsonb>>(e: E) -> E::Out;
110
111    /// The json_array_length(X) function returns the number of elements in the JSON array X,
112    /// or 0 if X is some kind of JSON value other than an array.
113    /// Errors are thrown if either X is not well-formed JSON or if P is not a well-formed path.
114    ///
115    /// This function requires at least SQLite 3.46 or newer
116    ///
117    /// # Example
118    ///
119    /// ```rust
120    /// # include!("../../doctest_setup.rs");
121    /// #
122    /// # // Reading the query result requires reading memory allocated by the
123    /// # // native sqlite library, which miri cannot track provenance for.
124    /// # #[cfg(miri)]
125    /// # fn main() {}
126    /// # #[cfg(not(miri))]
127    /// # fn main() {
128    /// #     #[cfg(feature = "serde_json")]
129    /// #     run_test().unwrap();
130    /// # }
131    /// #
132    /// # #[cfg(feature = "serde_json")]
133    /// # fn run_test() -> QueryResult<()> {
134    /// #     use diesel::dsl::{sql, json_array_length};
135    /// #     use serde_json::{json, Value};
136    /// #     use diesel::sql_types::{Json, Jsonb, Text, Nullable};
137    /// #     let connection = &mut establish_connection();
138    /// #     assert_version!(connection, 3, 46, 0);
139    ///
140    /// let result = diesel::select(json_array_length::<Json, _>(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::<Json, _>(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<Json>, _>(None::<Value>))
151    ///     .get_result::<Option<i32>>(connection)?;
152    ///
153    /// assert_eq!(None, result);
154    ///
155    /// let result = diesel::select(json_array_length::<Jsonb, _>(json!([1,2,3,4])))
156    ///     .get_result::<i32>(connection)?;
157    ///
158    /// assert_eq!(4, result);
159    ///
160    /// let result = diesel::select(json_array_length::<Jsonb, _>(json!({"one":[1,2,3]})))
161    ///     .get_result::<i32>(connection)?;
162    ///
163    /// assert_eq!(0, result);
164    ///
165    /// let result = diesel::select(json_array_length::<Nullable<Jsonb>, _>(None::<Value>))
166    ///     .get_result::<Option<i32>>(connection)?;
167    ///
168    /// assert_eq!(None, result);
169    ///
170    /// #     Ok(())
171    /// # }
172    /// ```
173    #[cfg(feature = "__sqlite-shared")]
174    fn json_array_length<
175        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Integer>,
176    >(
177        j: J,
178    ) -> J::Out;
179
180    /// The json_array_length(X) function returns the number of elements in the JSON array X,
181    /// or 0 if X is some kind of JSON value other than an array.
182    /// The json_array_length(X,P) locates the array at path P within X and returns the length of that array,
183    /// or 0 if path P locates an element in X that is not a JSON array,
184    /// and NULL if path P does not locate any element of X.
185    /// Errors are thrown if either X is not well-formed JSON or if P is not a well-formed path.
186    ///
187    /// This function requires at least SQLite 3.46 or newer
188    ///
189    /// # Example
190    ///
191    /// ```rust
192    /// # include!("../../doctest_setup.rs");
193    /// #
194    /// # // Reading the query result requires reading memory allocated by the
195    /// # // native sqlite library, which miri cannot track provenance for.
196    /// # #[cfg(miri)]
197    /// # fn main() {}
198    /// # #[cfg(not(miri))]
199    /// # fn main() {
200    /// #     #[cfg(feature = "serde_json")]
201    /// #     run_test().unwrap();
202    /// # }
203    /// #
204    /// # #[cfg(feature = "serde_json")]
205    /// # fn run_test() -> QueryResult<()> {
206    /// #     use diesel::dsl::{sql, json_array_length_with_path};
207    /// #     use serde_json::{json, Value};
208    /// #     use diesel::sql_types::{Json, Jsonb, Text, Nullable};
209    /// #     let connection = &mut establish_connection();
210    /// #     assert_version!(connection, 3, 46, 0);
211    ///
212    /// let result = diesel::select(json_array_length_with_path::<Json, _, _>(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::<Json, _, _>(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::<Json, _, _>(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<Json>, _, _>(json!({"one":[1,2,3]}), "$.two"))
228    ///     .get_result::<Option<i32>>(connection)?;
229    ///
230    /// assert_eq!(None, result);
231    ///
232    /// let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!([1,2,3,4]), "$"))
233    ///     .get_result::<Option<i32>>(connection)?;
234    ///
235    /// assert_eq!(Some(4), result);
236    ///
237    /// let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!([1,2,3,4]), "$[2]"))
238    ///     .get_result::<Option<i32>>(connection)?;
239    ///
240    /// assert_eq!(Some(0), result);
241    ///
242    /// let result = diesel::select(json_array_length_with_path::<Jsonb, _, _>(json!({"one":[1,2,3]}), "$.one"))
243    ///     .get_result::<Option<i32>>(connection)?;
244    ///
245    /// assert_eq!(Some(3), result);
246    ///
247    /// let result = diesel::select(json_array_length_with_path::<Nullable<Jsonb>, _, _>(json!({"one":[1,2,3]}), "$.two"))
248    ///     .get_result::<Option<i32>>(connection)?;
249    ///
250    /// assert_eq!(None, result);
251    ///
252    /// #     Ok(())
253    /// # }
254    /// ```
255    #[sql_name = "json_array_length"]
256    #[cfg(feature = "__sqlite-shared")]
257    fn json_array_length_with_path<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
258        j: J,
259        path: Text,
260    ) -> Nullable<Integer>;
261
262    /// The json_error_position(X) function returns 0 if the input X is a well-formed JSON or JSON5 string.
263    /// If the input X contains one or more syntax errors, then this function returns the character position of the first syntax error.
264    /// The left-most character is position 1.
265    ///
266    /// 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,
267    /// then it represents the approximate 1-based position in the BLOB of the first detected error.
268    ///
269    /// This function requires at least SQLite 3.46 or newer
270    ///
271    /// # Example
272    ///
273    /// ```rust
274    /// # include!("../../doctest_setup.rs");
275    /// #
276    /// # // Reading the query result requires reading memory allocated by the
277    /// # // native sqlite library, which miri cannot track provenance for.
278    /// # #[cfg(miri)]
279    /// # fn main() {}
280    /// # #[cfg(not(miri))]
281    /// # fn main() {
282    /// #     #[cfg(feature = "serde_json")]
283    /// #     run_test().unwrap();
284    /// # }
285    /// #
286    /// # #[cfg(feature = "serde_json")]
287    /// # fn run_test() -> QueryResult<()> {
288    /// #     use diesel::dsl::{sql, json_error_position};
289    /// #     use diesel::sql_types::{Binary, Text, Nullable};
290    /// #     let connection = &mut establish_connection();
291    /// #     assert_version!(connection, 3, 46, 0);
292    ///
293    /// let result = diesel::select(json_error_position::<Text, _>(r#"{"a": "b", "c": 1}"#))
294    ///     .get_result::<i32>(connection)?;
295    ///
296    /// assert_eq!(0, result);
297    ///
298    /// let result = diesel::select(json_error_position::<Text, _>(r#"{"a": b", "c": 1}"#))
299    ///     .get_result::<i32>(connection)?;
300    ///
301    /// assert_eq!(7, result);
302    ///
303    /// let json5 = r#"
304    ///     {
305    ///         // A traditional message.
306    ///         message: 'hello world',
307    ///
308    ///         // A number for some reason.
309    ///         n: 42,
310    ///     }
311    /// "#;
312    /// let result =
313    ///     diesel::select(json_error_position::<Text, _>(json5)).get_result::<i32>(connection)?;
314    ///
315    /// assert_eq!(0, result);
316    ///
317    /// let json5_with_error = r#"
318    ///     {
319    ///         // A traditional message.
320    ///         message: hello world',
321    ///
322    ///         // A number for some reason.
323    ///         n: 42,
324    ///     }
325    /// "#;
326    /// let result = diesel::select(json_error_position::<Text, _>(json5_with_error))
327    ///     .get_result::<i32>(connection)?;
328    ///
329    /// assert_eq!(59, result);
330    ///
331    /// let result = diesel::select(json_error_position::<Nullable<Text>, _>(None::<&str>))
332    ///     .get_result::<Option<i32>>(connection)?;
333    ///
334    /// assert_eq!(None, result);
335    ///
336    /// let result = diesel::select(json_error_position::<Binary, _>(br#"{"a": "b", "c": 1}"#))
337    ///     .get_result::<i32>(connection)?;
338    ///
339    /// assert_eq!(0, result);
340    ///
341    /// let result = diesel::select(json_error_position::<Binary, _>(br#"{"a": b", "c": 1}"#))
342    ///     .get_result::<i32>(connection)?;
343    ///
344    /// assert_eq!(7, result);
345    ///
346    /// let result = diesel::select(json_error_position::<Nullable<Binary>, _>(None::<Vec<u8>>))
347    ///     .get_result::<Option<i32>>(connection)?;
348    ///
349    /// assert_eq!(None, result);
350    ///
351    /// #     Ok(())
352    /// # }
353    /// ```
354    #[cfg(feature = "__sqlite-shared")]
355    fn json_error_position<
356        X: TextOrNullableTextOrBinaryOrNullableBinary + MaybeNullableValue<Integer>,
357    >(
358        x: X,
359    ) -> X::Out;
360
361    /// Extracts a text value from a well-formed JSON document at the given path.
362    ///
363    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
364    /// path is a JSON `null`.
365    ///
366    /// To extract other types, use:
367    /// - [`json_extract_integer`](json_extract_integer()) for integer values
368    /// - [`json_extract_double`](json_extract_double()) for floating-point values
369    /// - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays
370    ///
371    /// This function requires at least SQLite 3.9 or newer.
372    ///
373    /// # Example
374    ///
375    /// ```rust
376    /// # include!("../../doctest_setup.rs");
377    /// # // Reading the query result requires reading memory allocated by the
378    /// # // native sqlite library, which miri cannot track provenance for.
379    /// # #[cfg(miri)]
380    /// # fn main() {}
381    /// # #[cfg(not(miri))]
382    /// # fn main() {
383    /// #     #[cfg(feature = "serde_json")]
384    /// #     run_test().unwrap();
385    /// # }
386    /// # #[cfg(feature = "serde_json")]
387    /// # fn run_test() -> QueryResult<()> {
388    /// #     use diesel::dsl::*;
389    /// #     use diesel::sql_types::{Json, Nullable};
390    /// #     use serde_json::{json, Value};
391    /// #     let connection = &mut establish_connection();
392    /// #     assert_version!(connection, 3, 9, 0);
393    ///
394    /// let json = json!({"a": "xyz"});
395    /// let result = diesel::select(json_extract_string::<Json, _, _>(json, "$.a"))
396    ///     .get_result::<Option<String>>(connection)?;
397    /// assert_eq!(Some("xyz".to_string()), result);
398    ///
399    /// let json = json!({"a": 42});
400    /// let result = diesel::select(json_extract_string::<Json, _, _>(json, "$.a"))
401    ///     .get_result::<Option<String>>(connection)?;
402    /// assert_eq!(Some("42".to_string()), result);
403    ///
404    /// let result = diesel::select(json_extract_string::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
405    ///     .get_result::<Option<String>>(connection)?;
406    /// assert!(result.is_none());
407    ///
408    /// let json = json!({"a": "xyz"});
409    /// let result = diesel::select(json_extract_string::<Json, _, _>(json, "$.x"))
410    ///     .get_result::<Option<String>>(connection)?;
411    /// assert!(result.is_none());
412    ///
413    /// #     Ok(())
414    /// # }
415    /// ```
416    #[cfg(feature = "__sqlite-shared")]
417    #[sql_name = "json_extract"]
418    fn json_extract_string<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
419        json: J,
420        text: Text,
421    ) -> Nullable<Text>;
422
423    /// Extracts an integer value from a well-formed JSON document at the given path.
424    ///
425    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
426    /// path is a JSON `null`.
427    ///
428    /// To extract other types, use:
429    /// - [`json_extract_string`](json_extract_string()) for text values
430    /// - [`json_extract_double`](json_extract_double()) for floating-point values
431    /// - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays
432    ///
433    /// This function requires at least SQLite 3.9 or newer.
434    ///
435    /// # Example
436    ///
437    /// ```rust
438    /// # include!("../../doctest_setup.rs");
439    /// # // Reading the query result requires reading memory allocated by the
440    /// # // native sqlite library, which miri cannot track provenance for.
441    /// # #[cfg(miri)]
442    /// # fn main() {}
443    /// # #[cfg(not(miri))]
444    /// # fn main() {
445    /// #     #[cfg(feature = "serde_json")]
446    /// #     run_test().unwrap();
447    /// # }
448    /// # #[cfg(feature = "serde_json")]
449    /// # fn run_test() -> QueryResult<()> {
450    /// #     use diesel::dsl::*;
451    /// #     use diesel::sql_types::{Json, Nullable};
452    /// #     use serde_json::{json, Value};
453    /// #     let connection = &mut establish_connection();
454    /// #     assert_version!(connection, 3, 9, 0);
455    ///
456    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
457    /// let result = diesel::select(json_extract_integer::<Json, _, _>(json, "$.c[2].f"))
458    ///     .get_result::<Option<i32>>(connection)?;
459    /// assert_eq!(Some(7), result);
460    ///
461    /// let json = json!({"a": 3.7});
462    /// let result = diesel::select(json_extract_integer::<Json, _, _>(json, "$.a"))
463    ///     .get_result::<Option<i32>>(connection)?;
464    /// assert_eq!(Some(3), result);
465    ///
466    /// let result = diesel::select(json_extract_integer::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
467    ///     .get_result::<Option<i32>>(connection)?;
468    /// assert!(result.is_none());
469    ///
470    /// let json = json!({"a": 2});
471    /// let result = diesel::select(json_extract_integer::<Json, _, _>(json, "$.x"))
472    ///     .get_result::<Option<i32>>(connection)?;
473    /// assert!(result.is_none());
474    ///
475    /// #     Ok(())
476    /// # }
477    /// ```
478    #[cfg(feature = "__sqlite-shared")]
479    #[sql_name = "json_extract"]
480    fn json_extract_integer<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
481        json: J,
482        text: Text,
483    ) -> Nullable<Integer>;
484
485    /// Extracts a floating-point value from a well-formed JSON document at the given path.
486    ///
487    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
488    /// path is a JSON `null`.
489    ///
490    /// To extract other types, use:
491    /// - [`json_extract_string`](json_extract_string()) for text values
492    /// - [`json_extract_integer`](json_extract_integer()) for integer values
493    /// - [`json_extract_json`](json_extract_json_1()) for JSON objects or arrays
494    ///
495    /// This function requires at least SQLite 3.9 or newer.
496    ///
497    /// # Example
498    ///
499    /// ```rust
500    /// # include!("../../doctest_setup.rs");
501    /// # // Reading the query result requires reading memory allocated by the
502    /// # // native sqlite library, which miri cannot track provenance for.
503    /// # #[cfg(miri)]
504    /// # fn main() {}
505    /// # #[cfg(not(miri))]
506    /// # fn main() {
507    /// #     #[cfg(feature = "serde_json")]
508    /// #     run_test().unwrap();
509    /// # }
510    /// # #[cfg(feature = "serde_json")]
511    /// # fn run_test() -> QueryResult<()> {
512    /// #     use diesel::dsl::*;
513    /// #     use diesel::sql_types::{Json, Nullable};
514    /// #     use serde_json::{json, Value};
515    /// #     let connection = &mut establish_connection();
516    /// #     assert_version!(connection, 3, 9, 0);
517    ///
518    /// let json = json!({"a": 3.14});
519    /// let result = diesel::select(json_extract_double::<Json, _, _>(json, "$.a"))
520    ///     .get_result::<Option<f64>>(connection)?;
521    /// assert_eq!(Some(3.14), result);
522    ///
523    /// let json = json!({"a": 7});
524    /// let result = diesel::select(json_extract_double::<Json, _, _>(json, "$.a"))
525    ///     .get_result::<Option<f64>>(connection)?;
526    /// assert_eq!(Some(7.0), result);
527    ///
528    /// let result = diesel::select(json_extract_double::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
529    ///     .get_result::<Option<f64>>(connection)?;
530    /// assert!(result.is_none());
531    ///
532    /// let json = json!({"a": 3.14});
533    /// let result = diesel::select(json_extract_double::<Json, _, _>(json, "$.x"))
534    ///     .get_result::<Option<f64>>(connection)?;
535    /// assert!(result.is_none());
536    ///
537    /// #     Ok(())
538    /// # }
539    /// ```
540    #[cfg(feature = "__sqlite-shared")]
541    #[sql_name = "json_extract"]
542    fn json_extract_double<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
543        json: J,
544        text: Text,
545    ) -> Nullable<Double>;
546
547    /// Extracts a JSON object or array from a well-formed JSON document at the given path.
548    ///
549    /// When a single path is provided, returns the value at that path as a [`Json`] value.
550    /// When multiple paths are provided (using the variadic form), returns a JSON array
551    /// containing the extracted values.
552    ///
553    /// Returns `NULL` if a single path does not exist in the JSON document. With multiple paths,
554    /// missing paths appear as `null` inside the returned JSON array.
555    ///
556    /// To extract other types, use:
557    /// - [`json_extract_string`](json_extract_string()) for text values
558    /// - [`json_extract_integer`](json_extract_integer()) for integer values
559    /// - [`json_extract_double`](json_extract_double()) for floating-point values
560    ///
561    /// This function requires at least SQLite 3.9 or newer.
562    ///
563    /// # Example
564    ///
565    /// ```rust
566    /// # include!("../../doctest_setup.rs");
567    /// # // Reading the query result requires reading memory allocated by the
568    /// # // native sqlite library, which miri cannot track provenance for.
569    /// # #[cfg(miri)]
570    /// # fn main() {}
571    /// # #[cfg(not(miri))]
572    /// # fn main() {
573    /// #     #[cfg(feature = "serde_json")]
574    /// #     run_test().unwrap();
575    /// # }
576    /// # #[cfg(feature = "serde_json")]
577    /// # fn run_test() -> QueryResult<()> {
578    /// #     use diesel::dsl::*;
579    /// #     use diesel::sql_types::{Json, Nullable};
580    /// #     use serde_json::{json, Value};
581    /// #     let connection = &mut establish_connection();
582    /// #     assert_version!(connection, 3, 9, 0);
583    ///
584    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
585    /// let result = diesel::select(json_extract_json_1::<Json, _, _>(json, "$.c[2]"))
586    ///     .get_result::<Option<Value>>(connection)?;
587    /// assert_eq!(Some(json!({"f": 7})), result);
588    ///
589    /// let json = json!({"a": 2, "c": [4, 5], "f": 7});
590    /// let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, "$.c", "$.a"))
591    ///     .get_result::<Option<Value>>(connection)?;
592    /// assert_eq!(Some(json!([[4, 5], 2])), result);
593    ///
594    /// let json = json!({"a": 42});
595    /// let result = diesel::select(json_extract_json_1::<Json, _, _>(json, "$.a"))
596    ///     .get_result::<Option<Value>>(connection)?;
597    /// assert_eq!(Some(json!(42)), result);
598    ///
599    /// let json = json!({"a": 42});
600    /// let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, "$.a", "$.b"))
601    ///     .get_result::<Option<Value>>(connection)?;
602    /// assert_eq!(Some(json!([42, null])), result);
603    ///
604    /// let result = diesel::select(json_extract_json_1::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
605    ///     .get_result::<Option<Value>>(connection)?;
606    /// assert!(result.is_none());
607    ///
608    /// let json = json!({"a": 42});
609    /// let result = diesel::select(json_extract_json_1::<Json, _, _>(json, "$.x"))
610    ///     .get_result::<Option<Value>>(connection)?;
611    /// assert!(result.is_none());
612    ///
613    /// let json = json!({"a": 42});
614    /// let result = diesel::select(json_extract_json_2::<Json, _, _, _>(json, "$.b", "$.c"))
615    ///     .get_result::<Option<Value>>(connection)?;
616    /// assert_eq!(Some(json!([null, null])), result);
617    ///
618    /// #     Ok(())
619    /// # }
620    /// ```
621    #[cfg(feature = "__sqlite-shared")]
622    #[sql_name = "json_extract"]
623    #[variadic(last_arguments = 1, skip_zero_argument_variant = true)]
624    fn json_extract_json<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
625        json: J,
626        text: Text,
627    ) -> Nullable<Json>;
628
629    /// Extracts a text value from a well-formed JSON or JSONB document at the given path.
630    ///
631    /// Works identically to [`json_extract_string`](json_extract_string()) for scalar text values.
632    ///
633    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
634    /// path is a JSON `null`.
635    ///
636    /// To extract other types, use:
637    /// - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values
638    /// - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values
639    /// - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format
640    ///
641    /// This function requires at least SQLite 3.45 or newer.
642    ///
643    /// # Example
644    ///
645    /// ```rust
646    /// # include!("../../doctest_setup.rs");
647    /// # // Reading the query result requires reading memory allocated by the
648    /// # // native sqlite library, which miri cannot track provenance for.
649    /// # #[cfg(miri)]
650    /// # fn main() {}
651    /// # #[cfg(not(miri))]
652    /// # fn main() {
653    /// #     #[cfg(feature = "serde_json")]
654    /// #     run_test().unwrap();
655    /// # }
656    /// # #[cfg(feature = "serde_json")]
657    /// # fn run_test() -> QueryResult<()> {
658    /// #     use diesel::dsl::*;
659    /// #     use diesel::sql_types::{Json, Nullable};
660    /// #     use serde_json::{json, Value};
661    /// #     let connection = &mut establish_connection();
662    /// #     assert_version!(connection, 3, 45, 0);
663    ///
664    /// let json = json!({"a": "xyz"});
665    /// let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, "$.a"))
666    ///     .get_result::<Option<String>>(connection)?;
667    /// assert_eq!(Some("xyz".to_string()), result);
668    ///
669    /// let json = json!({"a": 42});
670    /// let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, "$.a"))
671    ///     .get_result::<Option<String>>(connection)?;
672    /// assert_eq!(Some("42".to_string()), result);
673    ///
674    /// let result = diesel::select(jsonb_extract_string::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
675    ///     .get_result::<Option<String>>(connection)?;
676    /// assert!(result.is_none());
677    ///
678    /// let json = json!({"a": "xyz"});
679    /// let result = diesel::select(jsonb_extract_string::<Json, _, _>(json, "$.x"))
680    ///     .get_result::<Option<String>>(connection)?;
681    /// assert!(result.is_none());
682    ///
683    /// #     Ok(())
684    /// # }
685    /// ```
686    #[cfg(feature = "__sqlite-shared")]
687    #[sql_name = "jsonb_extract"]
688    fn jsonb_extract_string<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
689        json: J,
690        text: Text,
691    ) -> Nullable<Text>;
692
693    /// Extracts an integer value from a well-formed JSON or JSONB document at the given path.
694    ///
695    /// Works identically to [`json_extract_integer`](json_extract_integer()) for integer values.
696    ///
697    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
698    /// path is a JSON `null`.
699    ///
700    /// To extract other types, use:
701    /// - [`jsonb_extract_string`](jsonb_extract_string()) for text values
702    /// - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values
703    /// - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format
704    ///
705    /// This function requires at least SQLite 3.45 or newer.
706    ///
707    /// # Example
708    ///
709    /// ```rust
710    /// # include!("../../doctest_setup.rs");
711    /// # // Reading the query result requires reading memory allocated by the
712    /// # // native sqlite library, which miri cannot track provenance for.
713    /// # #[cfg(miri)]
714    /// # fn main() {}
715    /// # #[cfg(not(miri))]
716    /// # fn main() {
717    /// #     #[cfg(feature = "serde_json")]
718    /// #     run_test().unwrap();
719    /// # }
720    /// # #[cfg(feature = "serde_json")]
721    /// # fn run_test() -> QueryResult<()> {
722    /// #     use diesel::dsl::*;
723    /// #     use diesel::sql_types::{Json, Nullable};
724    /// #     use serde_json::{json, Value};
725    /// #     let connection = &mut establish_connection();
726    /// #     assert_version!(connection, 3, 45, 0);
727    ///
728    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
729    /// let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, "$.c[2].f"))
730    ///     .get_result::<Option<i32>>(connection)?;
731    /// assert_eq!(Some(7), result);
732    ///
733    /// let json = json!({"a": 3.7});
734    /// let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, "$.a"))
735    ///     .get_result::<Option<i32>>(connection)?;
736    /// assert_eq!(Some(3), result);
737    ///
738    /// let result = diesel::select(jsonb_extract_integer::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
739    ///     .get_result::<Option<i32>>(connection)?;
740    /// assert!(result.is_none());
741    ///
742    /// let json = json!({"a": 2});
743    /// let result = diesel::select(jsonb_extract_integer::<Json, _, _>(json, "$.x"))
744    ///     .get_result::<Option<i32>>(connection)?;
745    /// assert!(result.is_none());
746    ///
747    /// #     Ok(())
748    /// # }
749    /// ```
750    #[cfg(feature = "__sqlite-shared")]
751    #[sql_name = "jsonb_extract"]
752    fn jsonb_extract_integer<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
753        json: J,
754        text: Text,
755    ) -> Nullable<Integer>;
756
757    /// Extracts a floating-point value from a well-formed JSON or JSONB document at the given path.
758    ///
759    /// Works identically to [`json_extract_double`](json_extract_double()) for floating-point values.
760    ///
761    /// Returns `NULL` if the path does not exist in the JSON document, or if the value at that
762    /// path is a JSON `null`.
763    ///
764    /// To extract other types, use:
765    /// - [`jsonb_extract_string`](jsonb_extract_string()) for text values
766    /// - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values
767    /// - [`jsonb_extract_jsonb`](jsonb_extract_jsonb_1()) for JSON objects or arrays in JSONB format
768    ///
769    /// This function requires at least SQLite 3.45 or newer.
770    ///
771    /// # Example
772    ///
773    /// ```rust
774    /// # include!("../../doctest_setup.rs");
775    /// # // Reading the query result requires reading memory allocated by the
776    /// # // native sqlite library, which miri cannot track provenance for.
777    /// # #[cfg(miri)]
778    /// # fn main() {}
779    /// # #[cfg(not(miri))]
780    /// # fn main() {
781    /// #     #[cfg(feature = "serde_json")]
782    /// #     run_test().unwrap();
783    /// # }
784    /// # #[cfg(feature = "serde_json")]
785    /// # fn run_test() -> QueryResult<()> {
786    /// #     use diesel::dsl::*;
787    /// #     use diesel::sql_types::{Json, Nullable};
788    /// #     use serde_json::{json, Value};
789    /// #     let connection = &mut establish_connection();
790    /// #     assert_version!(connection, 3, 45, 0);
791    ///
792    /// let json = json!({"a": 3.14});
793    /// let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, "$.a"))
794    ///     .get_result::<Option<f64>>(connection)?;
795    /// assert_eq!(Some(3.14), result);
796    ///
797    /// let json = json!({"a": 7});
798    /// let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, "$.a"))
799    ///     .get_result::<Option<f64>>(connection)?;
800    /// assert_eq!(Some(7.0), result);
801    ///
802    /// let result = diesel::select(jsonb_extract_double::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
803    ///     .get_result::<Option<f64>>(connection)?;
804    /// assert!(result.is_none());
805    ///
806    /// let json = json!({"a": 3.14});
807    /// let result = diesel::select(jsonb_extract_double::<Json, _, _>(json, "$.x"))
808    ///     .get_result::<Option<f64>>(connection)?;
809    /// assert!(result.is_none());
810    ///
811    /// #     Ok(())
812    /// # }
813    /// ```
814    #[cfg(feature = "__sqlite-shared")]
815    #[sql_name = "jsonb_extract"]
816    fn jsonb_extract_double<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
817        json: J,
818        text: Text,
819    ) -> Nullable<Double>;
820
821    /// Extracts a JSON object or array from a well-formed JSON or JSONB document at the given path,
822    /// returning it in JSONB format.
823    ///
824    /// Unlike [`json_extract_json`](json_extract_json_1()), which returns JSON objects and arrays
825    /// as text, this function returns them in the internal JSONB binary format. For scalar values
826    /// (text, integer, double, null), both functions behave identically.
827    ///
828    /// When a single path is provided, returns the value at that path as a [`Jsonb`] value.
829    /// When multiple paths are provided (using the variadic form), returns a JSONB array
830    /// containing the extracted values.
831    ///
832    /// Returns `NULL` if a single path does not exist in the JSON document. With multiple paths,
833    /// missing paths appear as `null` inside the returned JSONB array.
834    ///
835    /// To extract other types, use:
836    /// - [`jsonb_extract_string`](jsonb_extract_string()) for text values
837    /// - [`jsonb_extract_integer`](jsonb_extract_integer()) for integer values
838    /// - [`jsonb_extract_double`](jsonb_extract_double()) for floating-point values
839    ///
840    /// This function requires at least SQLite 3.45 or newer.
841    ///
842    /// # Example
843    ///
844    /// ```rust
845    /// # include!("../../doctest_setup.rs");
846    /// # // Reading the query result requires reading memory allocated by the
847    /// # // native sqlite library, which miri cannot track provenance for.
848    /// # #[cfg(miri)]
849    /// # fn main() {}
850    /// # #[cfg(not(miri))]
851    /// # fn main() {
852    /// #     #[cfg(feature = "serde_json")]
853    /// #     run_test().unwrap();
854    /// # }
855    /// # #[cfg(feature = "serde_json")]
856    /// # fn run_test() -> QueryResult<()> {
857    /// #     use diesel::dsl::*;
858    /// #     use diesel::sql_types::{Json, Jsonb, Nullable};
859    /// #     use serde_json::{json, Value};
860    /// #     let connection = &mut establish_connection();
861    /// #     assert_version!(connection, 3, 45, 0);
862    ///
863    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
864    /// let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, "$"))
865    ///     .get_result::<Option<Value>>(connection)?;
866    /// assert_eq!(Some(json!({"a": 2, "c": [4, 5, {"f": 7}]})), result);
867    ///
868    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
869    /// let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, "$.c"))
870    ///     .get_result::<Option<Value>>(connection)?;
871    /// assert_eq!(Some(json!([4, 5, {"f": 7}])), result);
872    ///
873    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
874    /// let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, "$.c[2]"))
875    ///     .get_result::<Option<Value>>(connection)?;
876    /// assert_eq!(Some(json!({"f": 7})), result);
877    ///
878    /// let json = json!({"a": 2, "c": [4, 5]});
879    /// let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, "$.c", "$.x"))
880    ///     .get_result::<Option<Value>>(connection)?;
881    /// assert_eq!(Some(json!([[4, 5], null])), result);
882    ///
883    /// let result = diesel::select(jsonb_extract_jsonb_1::<Nullable<Json>, _, _>(None::<Value>, "$.a"))
884    ///     .get_result::<Option<Value>>(connection)?;
885    /// assert!(result.is_none());
886    ///
887    /// let json = json!({"a": 2, "c": [4, 5, {"f": 7}]});
888    /// let result = diesel::select(jsonb_extract_jsonb_1::<Json, _, _>(json, "$.x"))
889    ///     .get_result::<Option<Value>>(connection)?;
890    /// assert_eq!(None, result);
891    ///
892    /// let json = json!({"a": 2, "c": [4, 5], "f": 7});
893    /// let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, "$.c", "$.a"))
894    ///     .get_result::<Option<Value>>(connection)?;
895    /// assert_eq!(Some(json!([[4, 5], 2])), result);
896    ///
897    /// let json = json!({"a": 2});
898    /// let result = diesel::select(jsonb_extract_jsonb_2::<Json, _, _, _>(json, "$.b", "$.c"))
899    ///     .get_result::<Option<Value>>(connection)?;
900    /// assert_eq!(Some(json!([null, null])), result);
901    ///
902    /// #     Ok(())
903    /// # }
904    /// ```
905    #[cfg(feature = "__sqlite-shared")]
906    #[sql_name = "jsonb_extract"]
907    #[variadic(last_arguments = 1, skip_zero_argument_variant = true)]
908    fn jsonb_extract_jsonb<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
909        json: J,
910        text: Text,
911    ) -> Nullable<Jsonb>;
912
913    /// Converts the given json value to pretty-printed, indented text
914    ///
915    /// This function requires at least SQLite 3.46 or newer
916    ///
917    /// # Example
918    ///
919    /// ```rust
920    /// # include!("../../doctest_setup.rs");
921    /// #
922    /// # // Reading the query result requires reading memory allocated by the
923    /// # // native sqlite library, which miri cannot track provenance for.
924    /// # #[cfg(miri)]
925    /// # fn main() {}
926    /// # #[cfg(not(miri))]
927    /// # fn main() {
928    /// #     #[cfg(feature = "serde_json")]
929    /// #     run_test().unwrap();
930    /// # }
931    /// #
932    /// # #[cfg(feature = "serde_json")]
933    /// # fn run_test() -> QueryResult<()> {
934    /// #     use diesel::dsl::{sql, json_pretty};
935    /// #     use serde_json::{json, Value};
936    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
937    /// #     let connection = &mut establish_connection();
938    /// #     assert_version!(connection, 3, 46, 0);
939    ///
940    /// let result = diesel::select(json_pretty::<Json, _>(json!([{"f1":1,"f2":null},2,null,3])))
941    ///     .get_result::<String>(connection)?;
942    ///
943    /// assert_eq!(r#"[
944    ///     {
945    ///         "f1": 1,
946    ///         "f2": null
947    ///     },
948    ///     2,
949    ///     null,
950    ///     3
951    /// ]"#, result);
952    ///
953    /// let result = diesel::select(json_pretty::<Json, _>(json!({"a": 1, "b": "cd"})))
954    ///     .get_result::<String>(connection)?;
955    ///
956    /// assert_eq!(r#"{
957    ///     "a": 1,
958    ///     "b": "cd"
959    /// }"#, result);
960    ///
961    /// let result = diesel::select(json_pretty::<Json, _>(json!("abc")))
962    ///     .get_result::<String>(connection)?;
963    ///
964    /// assert_eq!(r#""abc""#, result);
965    ///
966    /// let result = diesel::select(json_pretty::<Json, _>(json!(22)))
967    ///     .get_result::<String>(connection)?;
968    ///
969    /// assert_eq!(r#"22"#, result);
970    ///
971    /// let result = diesel::select(json_pretty::<Json, _>(json!(false)))
972    ///     .get_result::<String>(connection)?;
973    ///
974    /// assert_eq!(r#"false"#, result);
975    ///
976    /// let result = diesel::select(json_pretty::<Json, _>(json!(null)))
977    ///     .get_result::<String>(connection)?;
978    ///
979    /// assert_eq!(r#"null"#, result);
980    ///
981    /// let result = diesel::select(json_pretty::<Json, _>(json!({})))
982    ///     .get_result::<String>(connection)?;
983    ///
984    /// assert_eq!(r#"{}"#, result);
985    ///
986    /// let result = diesel::select(json_pretty::<Nullable<Json>, _>(None::<Value>))
987    ///     .get_result::<Option<String>>(connection)?;
988    ///
989    /// assert!(result.is_none());
990    ///
991    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!([{"f1":1,"f2":null},2,null,3])))
992    ///     .get_result::<String>(connection)?;
993    ///
994    /// assert_eq!(r#"[
995    ///     {
996    ///         "f1": 1,
997    ///         "f2": null
998    ///     },
999    ///     2,
1000    ///     null,
1001    ///     3
1002    /// ]"#, result);
1003    ///
1004    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!({"a": 1, "b": "cd"})))
1005    ///     .get_result::<String>(connection)?;
1006    ///
1007    /// assert_eq!(r#"{
1008    ///     "a": 1,
1009    ///     "b": "cd"
1010    /// }"#, result);
1011    ///
1012    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!("abc")))
1013    ///     .get_result::<String>(connection)?;
1014    ///
1015    /// assert_eq!(r#""abc""#, result);
1016    ///
1017    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!(22)))
1018    ///     .get_result::<String>(connection)?;
1019    ///
1020    /// assert_eq!(r#"22"#, result);
1021    ///
1022    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!(false)))
1023    ///     .get_result::<String>(connection)?;
1024    ///
1025    /// assert_eq!(r#"false"#, result);
1026    ///
1027    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!(null)))
1028    ///     .get_result::<String>(connection)?;
1029    ///
1030    /// assert_eq!(r#"null"#, result);
1031    ///
1032    /// let result = diesel::select(json_pretty::<Jsonb, _>(json!({})))
1033    ///     .get_result::<String>(connection)?;
1034    ///
1035    /// assert_eq!(r#"{}"#, result);
1036    ///
1037    /// let result = diesel::select(json_pretty::<Nullable<Jsonb>, _>(None::<Value>))
1038    ///     .get_result::<Option<String>>(connection)?;
1039    ///
1040    /// assert!(result.is_none());
1041    /// #     Ok(())
1042    /// # }
1043    /// ```
1044    fn json_pretty<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Text>>(
1045        j: J,
1046    ) -> J::Out;
1047
1048    /// Converts the given json value to pretty-printed, indented text
1049    ///
1050    /// This function requires at least SQLite 3.46 or newer
1051    ///
1052    /// # Example
1053    ///
1054    /// ```rust
1055    /// # include!("../../doctest_setup.rs");
1056    /// #
1057    /// # // Reading the query result requires reading memory allocated by the
1058    /// # // native sqlite library, which miri cannot track provenance for.
1059    /// # #[cfg(miri)]
1060    /// # fn main() {}
1061    /// # #[cfg(not(miri))]
1062    /// # fn main() {
1063    /// #     #[cfg(feature = "serde_json")]
1064    /// #     run_test().unwrap();
1065    /// # }
1066    /// #
1067    /// # #[cfg(feature = "serde_json")]
1068    /// # fn run_test() -> QueryResult<()> {
1069    /// #     use diesel::dsl::{sql, json_pretty_with_indentation};
1070    /// #     use serde_json::{json, Value};
1071    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1072    /// #     let connection = &mut establish_connection();
1073    /// #     assert_version!(connection, 3, 46, 0);
1074    ///
1075    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!([{"f1":1,"f2":null},2,null,3]), "  "))
1076    ///     .get_result::<String>(connection)?;
1077    ///
1078    /// assert_eq!(r#"[
1079    ///   {
1080    ///     "f1": 1,
1081    ///     "f2": null
1082    ///   },
1083    ///   2,
1084    ///   null,
1085    ///   3
1086    /// ]"#, result);
1087    ///
1088    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!([{"f1":1,"f2":null},2,null,3]), None::<&str>))
1089    ///     .get_result::<String>(connection)?;
1090    ///
1091    /// assert_eq!(r#"[
1092    ///     {
1093    ///         "f1": 1,
1094    ///         "f2": null
1095    ///     },
1096    ///     2,
1097    ///     null,
1098    ///     3
1099    /// ]"#, result);
1100    ///
1101    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!({"a": 1, "b": "cd"}), "  "))
1102    ///     .get_result::<String>(connection)?;
1103    ///
1104    /// assert_eq!(r#"{
1105    ///   "a": 1,
1106    ///   "b": "cd"
1107    /// }"#, result);
1108    ///
1109    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!("abc"), "  "))
1110    ///     .get_result::<String>(connection)?;
1111    ///
1112    /// assert_eq!(r#""abc""#, result);
1113    ///
1114    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(22), "  "))
1115    ///     .get_result::<String>(connection)?;
1116    ///
1117    /// assert_eq!(r#"22"#, result);
1118    ///
1119    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(false), None::<&str>))
1120    ///     .get_result::<String>(connection)?;
1121    ///
1122    /// assert_eq!(r#"false"#, result);
1123    ///
1124    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!(null), None::<&str>))
1125    ///     .get_result::<String>(connection)?;
1126    ///
1127    /// assert_eq!(r#"null"#, result);
1128    ///
1129    /// let result = diesel::select(json_pretty_with_indentation::<Json, _, _>(json!({}), "  "))
1130    ///     .get_result::<String>(connection)?;
1131    ///
1132    /// assert_eq!(r#"{}"#, result);
1133    ///
1134    /// let result = diesel::select(json_pretty_with_indentation::<Nullable<Json>, _, _>(None::<Value>, None::<&str>))
1135    ///     .get_result::<Option<String>>(connection)?;
1136    ///
1137    /// assert!(result.is_none());
1138    ///
1139    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!([{"f1":1,"f2":null},2,null,3]), "  "))
1140    ///     .get_result::<String>(connection)?;
1141    ///
1142    /// assert_eq!(r#"[
1143    ///   {
1144    ///     "f1": 1,
1145    ///     "f2": null
1146    ///   },
1147    ///   2,
1148    ///   null,
1149    ///   3
1150    /// ]"#, result);
1151    ///
1152    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!([{"f1":1,"f2":null},2,null,3]), None::<&str>))
1153    ///     .get_result::<String>(connection)?;
1154    ///
1155    /// assert_eq!(r#"[
1156    ///     {
1157    ///         "f1": 1,
1158    ///         "f2": null
1159    ///     },
1160    ///     2,
1161    ///     null,
1162    ///     3
1163    /// ]"#, result);
1164    ///
1165    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!({"a": 1, "b": "cd"}), "  "))
1166    ///     .get_result::<String>(connection)?;
1167    ///
1168    /// assert_eq!(r#"{
1169    ///   "a": 1,
1170    ///   "b": "cd"
1171    /// }"#, result);
1172    ///
1173    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!("abc"), "  "))
1174    ///     .get_result::<String>(connection)?;
1175    ///
1176    /// assert_eq!(r#""abc""#, result);
1177    ///
1178    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(22), "  "))
1179    ///     .get_result::<String>(connection)?;
1180    ///
1181    /// assert_eq!(r#"22"#, result);
1182    ///
1183    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(false), None::<&str>))
1184    ///     .get_result::<String>(connection)?;
1185    ///
1186    /// assert_eq!(r#"false"#, result);
1187    ///
1188    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!(null), None::<&str>))
1189    ///     .get_result::<String>(connection)?;
1190    ///
1191    /// assert_eq!(r#"null"#, result);
1192    ///
1193    /// let result = diesel::select(json_pretty_with_indentation::<Jsonb, _, _>(json!({}), "  "))
1194    ///     .get_result::<String>(connection)?;
1195    ///
1196    /// assert_eq!(r#"{}"#, result);
1197    ///
1198    /// let result = diesel::select(json_pretty_with_indentation::<Nullable<Jsonb>, _, _>(None::<Value>, None::<&str>))
1199    ///     .get_result::<Option<String>>(connection)?;
1200    ///
1201    /// assert!(result.is_none());
1202    ///
1203    /// #     Ok(())
1204    /// # }
1205    /// ```
1206    #[sql_name = "json_pretty"]
1207    fn json_pretty_with_indentation<
1208        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Text>,
1209    >(
1210        j: J,
1211        indentation: Nullable<Text>,
1212    ) -> J::Out;
1213
1214    /// Returns  `true`  if the argument is well-formed JSON, or returns  `false`  if is not well-formed.
1215    ///
1216    /// This function requires at least SQLite 3.46 or newer
1217    ///
1218    /// # Example
1219    ///
1220    /// ```rust
1221    /// # include!("../../doctest_setup.rs");
1222    /// #
1223    /// # // Reading the query result requires reading memory allocated by the
1224    /// # // native sqlite library, which miri cannot track provenance for.
1225    /// # #[cfg(miri)]
1226    /// # fn main() {}
1227    /// # #[cfg(not(miri))]
1228    /// # fn main() {
1229    /// #     #[cfg(feature = "serde_json")]
1230    /// #     run_test().unwrap();
1231    /// # }
1232    /// #
1233    /// # #[cfg(feature = "serde_json")]
1234    /// # fn run_test() -> QueryResult<()> {
1235    /// #     use diesel::dsl::{sql, json_valid};
1236    /// #     use serde_json::{json, Value};
1237    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1238    /// #     let connection = &mut establish_connection();
1239    /// #     assert_version!(connection, 3, 46, 0);
1240    ///
1241    /// let result = diesel::select(json_valid::<Json, _>(json!({"x":35})))
1242    ///     .get_result::<bool>(connection)?;
1243    ///
1244    /// assert_eq!(true, result);
1245    ///
1246    /// let result = diesel::select(json_valid::<Nullable<Json>, _>(None::<serde_json::Value>))
1247    ///     .get_result::<Option<bool>>(connection)?;
1248    ///
1249    /// assert_eq!(None, result);
1250    ///
1251    /// # Ok(())
1252    /// # }
1253    /// ```
1254    #[sql_name = "json_valid"]
1255    #[cfg(feature = "__sqlite-shared")]
1256    fn json_valid<J: JsonOrNullableJson + MaybeNullableValue<Bool>>(j: J) -> J::Out;
1257
1258    /// 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.
1259    /// The Y parameter is an integer bitmask that defines what is meant by "well-formed".
1260    ///
1261    /// The following bits of Y are currently defined:
1262    /// - 0x01 → The input is text that strictly complies with canonical RFC-8259 JSON, without any extensions.
1263    /// - 0x02 → The input is text that is JSON with JSON5 extensions.
1264    /// - 0x04 → The input is a BLOB that superficially appears to be JSONB.
1265    /// - 0x08 → The input is a BLOB that strictly conforms to the internal JSONB format.
1266    ///
1267    /// By combining bits, the following useful values of Y can be derived:
1268    /// - 1 → X is RFC-8259 JSON text
1269    /// - 2 → X is JSON5 text
1270    /// - 4 → X is probably JSONB
1271    /// - 5 → X is RFC-8259 JSON text or JSONB
1272    /// - 6 → X is JSON5 text or JSONB (recommended for most use cases)
1273    /// - 8 → X is strictly conforming JSONB
1274    /// - 9 → X is RFC-8259 or strictly conforming JSONB
1275    /// - 10 → X is JSON5 or strictly conforming JSONB
1276    ///
1277    /// The Y parameter must be between 1 and 15 (inclusive), or an error is raised.
1278    ///
1279    /// If either X or Y inputs are NULL, then the function returns NULL.
1280    ///
1281    /// This function requires at least SQLite 3.46 or newer
1282    ///
1283    /// # Example
1284    ///
1285    /// ```rust
1286    /// # include!("../../doctest_setup.rs");
1287    /// #
1288    /// # // Reading the query result requires reading memory allocated by the
1289    /// # // native sqlite library, which miri cannot track provenance for.
1290    /// # #[cfg(miri)]
1291    /// # fn main() {}
1292    /// # #[cfg(not(miri))]
1293    /// # fn main() {
1294    /// #     #[cfg(feature = "serde_json")]
1295    /// #     run_test().unwrap();
1296    /// # }
1297    /// #
1298    /// # #[cfg(feature = "serde_json")]
1299    /// # fn run_test() -> QueryResult<()> {
1300    /// #     use diesel::dsl::{sql, json_valid_with_flags};
1301    /// #     use diesel::sqlite::JsonValidFlag;
1302    /// #     use serde_json::{json, Value};
1303    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1304    /// #     let connection = &mut establish_connection();
1305    /// #     assert_version!(connection, 3, 46, 0);
1306    ///
1307    /// // Standard RFC-8259 JSON
1308    /// let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#"{"x":35}"#, JsonValidFlag::Rfc8259Json))
1309    ///     .get_result::<bool>(connection)?;
1310    /// assert_eq!(true, result);
1311    ///
1312    /// // JSON5 not valid as RFC-8259
1313    /// let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#"{x:35}"#, JsonValidFlag::Rfc8259Json))
1314    ///     .get_result::<bool>(connection)?;
1315    /// assert_eq!(false, result);
1316    ///
1317    /// // JSON5 valid with JSON5 flag
1318    /// let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#"{x:35}"#, JsonValidFlag::Json5OrJsonb))
1319    ///     .get_result::<bool>(connection)?;
1320    /// assert_eq!(true, result);
1321    ///
1322    /// // Invalid JSON
1323    /// let result = diesel::select(json_valid_with_flags::<Text, _, _>(r#"{"x":35"#, JsonValidFlag::Rfc8259Json))
1324    ///     .get_result::<bool>(connection)?;
1325    /// assert_eq!(false, result);
1326    ///
1327    /// // NULL input returns NULL
1328    /// let result = diesel::select(json_valid_with_flags::<Nullable<Text>, _, _>(None::<&str>, JsonValidFlag::Rfc8259Json))
1329    ///     .get_result::<Option<bool>>(connection)?;
1330    /// assert_eq!(None, result);
1331    ///
1332    /// # Ok(())
1333    /// # }
1334    /// ```
1335    #[sql_name = "json_valid"]
1336    #[cfg(feature = "__sqlite-shared")]
1337    fn json_valid_with_flags<
1338        X: TextOrNullableTextOrBinaryOrNullableBinary + SingleValue + MaybeNullableValue<Bool>,
1339    >(
1340        x: X,
1341        flags: crate::sqlite::types::JsonValidFlags,
1342    ) -> X::Out;
1343
1344    /// The json_type(X) function returns the "type" of the outermost element of X.
1345    /// The "type" returned by json_type() is one of the following SQL text values:
1346    /// 'null', 'true', 'false', 'integer', 'real', 'text', 'array', or 'object'.
1347    ///
1348    /// This function requires at least SQLite 3.38 or newer
1349    ///
1350    /// # Example
1351    ///
1352    /// ```rust
1353    /// # include!("../../doctest_setup.rs");
1354    /// #
1355    /// # // Reading the query result requires reading memory allocated by the
1356    /// # // native sqlite library, which miri cannot track provenance for.
1357    /// # #[cfg(miri)]
1358    /// # fn main() {}
1359    /// # #[cfg(not(miri))]
1360    /// # fn main() {
1361    /// #     #[cfg(feature = "serde_json")]
1362    /// #     run_test().unwrap();
1363    /// # }
1364    /// #
1365    /// # #[cfg(feature = "serde_json")]
1366    /// # fn run_test() -> QueryResult<()> {
1367    /// #     use diesel::dsl::{sql, json_type};
1368    /// #     use serde_json::{json, Value};
1369    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1370    /// #     let connection = &mut establish_connection();
1371    /// #     assert_version!(connection, 3, 38, 0);
1372    ///
1373    /// let result = diesel::select(json_type::<Json, _>(json!({"a": [2, 3.5, true, false, null, "x"]})))
1374    ///     .get_result::<String>(connection)?;
1375    ///
1376    /// assert_eq!("object", result);
1377    ///
1378    /// let result = diesel::select(json_type::<Jsonb, _>(json!({"a": [2, 3.5, true, false, null, "x"]})))
1379    ///     .get_result::<String>(connection)?;
1380    ///
1381    /// assert_eq!("object", result);
1382    ///
1383    /// let result = diesel::select(json_type::<Nullable<Json>, _>(None::<serde_json::Value>))
1384    ///     .get_result::<Option<String>>(connection)?;
1385    ///
1386    /// assert_eq!(None, result);
1387    ///
1388    /// # Ok(())
1389    /// # }
1390    /// ```
1391    #[sql_name = "json_type"]
1392    #[cfg(feature = "__sqlite-shared")]
1393    fn json_type<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Text>>(
1394        j: J,
1395    ) -> J::Out;
1396
1397    /// The json_type(X,P) function returns the "type" of the element in X that is selected by path P.
1398    /// If the path P in json_type(X,P) selects an element that does not exist in X, then this function returns NULL.
1399    ///
1400    /// This function requires at least SQLite 3.38 or newer
1401    ///
1402    /// # Example
1403    ///
1404    /// ```rust
1405    /// # include!("../../doctest_setup.rs");
1406    /// #
1407    /// # // Reading the query result requires reading memory allocated by the
1408    /// # // native sqlite library, which miri cannot track provenance for.
1409    /// # #[cfg(miri)]
1410    /// # fn main() {}
1411    /// # #[cfg(not(miri))]
1412    /// # fn main() {
1413    /// #     #[cfg(feature = "serde_json")]
1414    /// #     run_test().unwrap();
1415    /// # }
1416    /// #
1417    /// # #[cfg(feature = "serde_json")]
1418    /// # fn run_test() -> QueryResult<()> {
1419    /// #     use diesel::dsl::{sql, json_type_with_path};
1420    /// #     use serde_json::{json, Value};
1421    /// #     use diesel::sql_types::{Text, Json, Jsonb, Nullable};
1422    /// #     let connection = &mut establish_connection();
1423    /// #     assert_version!(connection, 3, 38, 0);
1424    ///
1425    /// let json_value = json!({"a": [2, 3.5, true, false, null, "x"]});
1426    ///
1427    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a"))
1428    ///     .get_result::<Option<String>>(connection)?;
1429    ///
1430    /// assert_eq!(Some("array".to_string()), result);
1431    ///
1432    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a[0]"))
1433    ///     .get_result::<Option<String>>(connection)?;
1434    ///
1435    /// assert_eq!(Some("integer".to_string()), result);
1436    ///
1437    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a[1]"))
1438    ///     .get_result::<Option<String>>(connection)?;
1439    ///
1440    /// assert_eq!(Some("real".to_string()), result);
1441    ///
1442    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a[2]"))
1443    ///     .get_result::<Option<String>>(connection)?;
1444    ///
1445    /// assert_eq!(Some("true".to_string()), result);
1446    ///
1447    /// let result = diesel::select(json_type_with_path::<Json, _, _>(json_value.clone(), "$.a[6]"))
1448    ///     .get_result::<Option<String>>(connection)?;
1449    ///
1450    /// assert_eq!(None, result);
1451    ///
1452    /// let result = diesel::select(json_type_with_path::<Jsonb, _, _>(json_value.clone(), "$.a"))
1453    ///     .get_result::<Option<String>>(connection)?;
1454    ///
1455    /// assert_eq!(Some("array".to_string()), result);
1456    ///
1457    /// let result = diesel::select(json_type_with_path::<Nullable<Json>, _, _>(None::<serde_json::Value>, "$.a"))
1458    ///     .get_result::<Option<String>>(connection)?;
1459    ///
1460    /// assert_eq!(None, result);
1461    ///
1462    /// # Ok(())
1463    /// # }
1464    /// ```
1465    #[sql_name = "json_type"]
1466    #[cfg(feature = "__sqlite-shared")]
1467    fn json_type_with_path<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
1468        j: J,
1469        path: Text,
1470    ) -> Nullable<Text>;
1471
1472    /// The json_quote(X) function converts the SQL value X (a number or a string) into its corresponding JSON
1473    /// representation. If X is a JSON value returned by another JSON function, then this function is a no-op.
1474    ///
1475    /// This function requires at least SQLite 3.38 or newer
1476    ///
1477    /// # Example
1478    ///
1479    /// ```rust
1480    /// # include!("../../doctest_setup.rs");
1481    /// #
1482    /// # // Reading the query result requires reading memory allocated by the
1483    /// # // native sqlite library, which miri cannot track provenance for.
1484    /// # #[cfg(miri)]
1485    /// # fn main() {}
1486    /// # #[cfg(not(miri))]
1487    /// # fn main() {
1488    /// #     #[cfg(feature = "serde_json")]
1489    /// #     run_test().unwrap();
1490    /// # }
1491    /// #
1492    /// # #[cfg(feature = "serde_json")]
1493    /// # fn run_test() -> QueryResult<()> {
1494    /// #     use diesel::dsl::{sql, json_quote};
1495    /// #     use serde_json::{json, Value};
1496    /// #     use diesel::sql_types::{Text, Json, Integer, Float, Double, Nullable};
1497    /// #     let connection = &mut establish_connection();
1498    /// #     assert_version!(connection, 3, 38, 0);
1499    ///
1500    /// let result = diesel::select(json_quote::<Integer, _>(42))
1501    ///     .get_result::<Value>(connection)?;
1502    /// assert_eq!(json!(42), result);
1503    ///
1504    /// let result = diesel::select(json_quote::<Text, _>("verdant"))
1505    ///     .get_result::<Value>(connection)?;
1506    /// assert_eq!(json!("verdant"), result);
1507    ///
1508    /// let result = diesel::select(json_quote::<Text, _>("[1]"))
1509    ///     .get_result::<Value>(connection)?;
1510    /// assert_eq!(json!("[1]"), result);
1511    ///
1512    /// let result = diesel::select(json_quote::<Nullable<Text>, _>(None::<&str>))
1513    ///     .get_result::<Value>(connection)?;
1514    /// assert_eq!(json!(null), result);
1515    ///
1516    /// let result = diesel::select(json_quote::<Double, _>(3.14159))
1517    ///     .get_result::<Value>(connection)?;
1518    /// assert_eq!(json!(3.14159), result);
1519    ///
1520    /// let result = diesel::select(json_quote::<Json, _>(json!([1])))
1521    ///     .get_result::<Value>(connection)?;
1522    // assert_eq!(json!([1]), result);
1523    ///
1524    ///
1525    /// # Ok(())
1526    /// # }
1527    /// ```
1528    #[sql_name = "json_quote"]
1529    #[cfg(feature = "__sqlite-shared")]
1530    fn json_quote<J: SqlType + SingleValue>(j: J) -> Json;
1531
1532    /// The `json_group_array(X)` function is an aggregate SQL function that returns a JSON array comprised of
1533    /// all X values in the aggregation.
1534    ///
1535    /// ## Aggregate Function Expression
1536    ///
1537    /// This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details.
1538    ///
1539    /// # Examples
1540    ///
1541    /// ## Normal function usage
1542    ///
1543    /// ```rust
1544    /// # include!("../../doctest_setup.rs");
1545    /// #
1546    /// # // Reading the query result requires reading memory allocated by the
1547    /// # // native sqlite library, which miri cannot track provenance for.
1548    /// # #[cfg(miri)]
1549    /// # fn main() {}
1550    /// # #[cfg(not(miri))]
1551    /// # fn main() {
1552    /// #     #[cfg(feature = "serde_json")]
1553    /// #     run_test().unwrap();
1554    /// # }
1555    /// #
1556    /// # #[cfg(feature = "serde_json")]
1557    /// # fn run_test() -> QueryResult<()> {
1558    /// #     use diesel::dsl::*;
1559    /// #     use schema::animals::dsl::*;
1560    /// #     use serde_json::json;
1561    /// #
1562    /// #     let connection = &mut establish_connection();
1563    /// #
1564    /// let result = animals
1565    ///     .select(json_group_array(species))
1566    ///     .get_result::<serde_json::Value>(connection)?;
1567    /// assert_eq!(result, json!(["dog", "spider"]));
1568    ///
1569    /// let result = animals
1570    ///     .select(json_group_array(legs))
1571    ///     .get_result::<serde_json::Value>(connection)?;
1572    /// assert_eq!(result, json!([4, 8]));
1573    ///
1574    /// let result = animals
1575    ///     .select(json_group_array(name))
1576    ///     .get_result::<serde_json::Value>(connection)?;
1577    /// assert_eq!(result, json!(["Jack", null]));
1578    ///
1579    /// # Ok(())
1580    /// # }
1581    /// ```
1582    /// ## Aggregate function expression
1583    ///
1584    /// ```rust
1585    /// # include!("../../doctest_setup.rs");
1586    /// #
1587    /// # // Reading the query result requires reading memory allocated by the
1588    /// # // native sqlite library, which miri cannot track provenance for.
1589    /// # #[cfg(miri)]
1590    /// # fn main() {}
1591    /// # #[cfg(not(miri))]
1592    /// # fn main() {
1593    /// #     #[cfg(feature = "serde_json")]
1594    /// #     run_test().unwrap();
1595    /// # }
1596    /// #
1597    /// # #[cfg(feature = "serde_json")]
1598    /// # fn run_test() -> QueryResult<()> {
1599    /// #     use diesel::dsl::*;
1600    /// #     use schema::animals::dsl::*;
1601    /// #     use serde_json::json;
1602    /// #
1603    /// #     let connection = &mut establish_connection();
1604    /// #
1605    /// let result = animals
1606    ///     .select(json_group_array(species).aggregate_filter(legs.lt(8)))
1607    ///     .get_result::<serde_json::Value>(connection)?;
1608    /// assert_eq!(result, json!(["dog"]));
1609    ///
1610    /// # Ok(())
1611    /// # }
1612    /// ```
1613    ///
1614    /// # See also
1615    /// - [`jsonb_group_array`](jsonb_group_array()) will return data in JSONB format instead of JSON.
1616    /// - [`json_group_object`](json_group_object()) will return JSON object instead of array.
1617    #[cfg(feature = "__sqlite-shared")]
1618    #[aggregate]
1619    fn json_group_array<E: SqlType + SingleValue>(elements: E) -> Json;
1620
1621    /// The `jsonb_group_array(X)` function is an aggregate SQL function that returns a JSONB array comprised of
1622    /// all X values in the aggregation.
1623    ///
1624    /// This function requires at least SQLite 3.45 or newer
1625    ///
1626    /// ## Aggregate Function Expression
1627    ///
1628    /// This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details.
1629    ///
1630    /// # Examples
1631    ///
1632    /// ## Normal function usage
1633    ///
1634    /// ```rust
1635    /// # include!("../../doctest_setup.rs");
1636    /// #
1637    /// # // Reading the query result requires reading memory allocated by the
1638    /// # // native sqlite library, which miri cannot track provenance for.
1639    /// # #[cfg(miri)]
1640    /// # fn main() {}
1641    /// # #[cfg(not(miri))]
1642    /// # fn main() {
1643    /// #     #[cfg(feature = "serde_json")]
1644    /// #     run_test().unwrap();
1645    /// # }
1646    /// #
1647    /// # #[cfg(feature = "serde_json")]
1648    /// # fn run_test() -> QueryResult<()> {
1649    /// #     use diesel::dsl::*;
1650    /// #     use serde_json::json;
1651    /// #     use schema::animals::dsl::*;
1652    /// #
1653    /// #     let connection = &mut establish_connection();
1654    /// #     assert_version!(connection, 3, 45, 0);
1655    /// #
1656    /// let result = animals
1657    ///     .select(jsonb_group_array(species))
1658    ///     .get_result::<serde_json::Value>(connection)?;
1659    /// assert_eq!(result, json!(["dog", "spider"]));
1660    ///
1661    /// let result = animals
1662    ///     .select(jsonb_group_array(legs))
1663    ///     .get_result::<serde_json::Value>(connection)?;
1664    /// assert_eq!(result, json!([4, 8]));
1665    ///
1666    /// let result = animals
1667    ///     .select(jsonb_group_array(name))
1668    ///     .get_result::<serde_json::Value>(connection)?;
1669    /// assert_eq!(result, json!(["Jack", null]));
1670    ///
1671    /// # Ok(())
1672    /// # }
1673    /// ```
1674    ///
1675    /// ## Aggregate function expression
1676    ///
1677    /// ```rust
1678    /// # include!("../../doctest_setup.rs");
1679    /// #
1680    /// # // Reading the query result requires reading memory allocated by the
1681    /// # // native sqlite library, which miri cannot track provenance for.
1682    /// # #[cfg(miri)]
1683    /// # fn main() {}
1684    /// # #[cfg(not(miri))]
1685    /// # fn main() {
1686    /// #     #[cfg(feature = "serde_json")]
1687    /// #     run_test().unwrap();
1688    /// # }
1689    /// #
1690    /// # #[cfg(feature = "serde_json")]
1691    /// # fn run_test() -> QueryResult<()> {
1692    /// #     use diesel::dsl::*;
1693    /// #     use serde_json::json;
1694    /// #     use schema::animals::dsl::*;
1695    /// #
1696    /// #     let connection = &mut establish_connection();
1697    /// #     assert_version!(connection, 3, 45, 0);
1698    /// #
1699    /// let result = animals
1700    ///     .select(jsonb_group_array(species).aggregate_filter(legs.lt(8)))
1701    ///     .get_result::<serde_json::Value>(connection)?;
1702    /// assert_eq!(result, json!(["dog"]));
1703    ///
1704    /// # Ok(())
1705    /// # }
1706    /// ```
1707    ///
1708    /// # See also
1709    /// - [`json_group_array`](json_group_array()) will return data in JSON format instead of JSONB.
1710    /// - [`jsonb_group_object`](jsonb_group_object()) will return JSONB object instead of array.
1711    #[cfg(feature = "__sqlite-shared")]
1712    #[aggregate]
1713    fn jsonb_group_array<E: SqlType + SingleValue>(elements: E) -> Jsonb;
1714
1715    /// The `json_object()` SQL function accepts zero or more pairs of arguments and returns a
1716    /// well-formed JSON object composed from those pairs. The first argument of each pair is the
1717    /// label (key) and the second argument is the value. If any argument to `json_object()` is a
1718    /// BLOB then an error is thrown.
1719    ///
1720    /// An argument with SQL type TEXT is normally converted into a quoted JSON string even if the
1721    /// input text is well-formed JSON. However, if the argument is the direct result from another
1722    /// JSON function, then it is treated as JSON and all of its JSON type information and
1723    /// substructure is preserved. This allows calls to `json_object()` and `json_array()` to be
1724    /// nested. The [`json()`] function can also be used to force strings to be recognized as JSON.
1725    ///
1726    /// This function requires at least SQLite 3.38 or newer
1727    ///
1728    /// # Examples
1729    ///
1730    /// ```rust
1731    /// # include!("../../doctest_setup.rs");
1732    /// #
1733    /// # // Reading the query result requires reading memory allocated by the
1734    /// # // native sqlite library, which miri cannot track provenance for.
1735    /// # #[cfg(miri)]
1736    /// # fn main() {}
1737    /// # #[cfg(not(miri))]
1738    /// # fn main() {
1739    /// #     #[cfg(feature = "serde_json")]
1740    /// #     run_test().unwrap();
1741    /// # }
1742    /// #
1743    /// # #[cfg(feature = "serde_json")]
1744    /// # fn run_test() -> QueryResult<()> {
1745    /// #     use diesel::dsl::*;
1746    /// #     use diesel::sql_types::{Text, Integer};
1747    /// #     use serde_json::json;
1748    /// #
1749    /// #     let connection = &mut establish_connection();
1750    /// #     assert_version!(connection, 3, 38, 0);
1751    /// #
1752    /// let result = diesel::select(json_object_0()).get_result::<serde_json::Value>(connection)?;
1753    /// assert_eq!(json!({}), result);
1754    ///
1755    /// let result = diesel::select(json_object_1::<Text, Integer, _, _>("a", 2))
1756    ///     .get_result::<serde_json::Value>(connection)?;
1757    /// assert_eq!(json!({"a": 2}), result);
1758    ///
1759    /// let result = diesel::select(
1760    ///     json_object_2::<Text, Integer, Text, Text, _, _, _, _>("a", 2, "c", "{e:5}")
1761    /// )
1762    /// .get_result::<serde_json::Value>(connection)?;
1763    /// assert_eq!(json!({"a": 2, "c": "{e:5}"}), result);
1764    ///
1765    /// let result = diesel::select(
1766    ///     json_object_2::<Text, Integer, Text, Json, _, _, _, _>("a", 2, "c", json_object_1::<Text, Integer, _, _>("e", 5))
1767    /// )
1768    /// .get_result::<serde_json::Value>(connection)?;
1769    /// assert_eq!(json!({"a": 2, "c": {"e": 5}}), result);
1770    /// #
1771    /// # Ok(())
1772    /// # }
1773    /// ```
1774    #[cfg(feature = "__sqlite-shared")]
1775    #[variadic(2)]
1776    fn json_object<K: NotBlob<IsNull = is_nullable::NotNull>, V: NotBlob>(key: K, value: V)
1777    -> Json;
1778
1779    /// The `jsonb_object()` SQL function works just like the [`json_object()`](json_object_1())
1780    /// function except that the generated object is returned in SQLite's private binary JSONB
1781    /// format rather than in the standard RFC 8259 text format.
1782    ///
1783    /// This function requires at least SQLite 3.45 or newer
1784    ///
1785    /// # Examples
1786    ///
1787    /// ```rust
1788    /// # include!("../../doctest_setup.rs");
1789    /// #
1790    /// # // Reading the query result requires reading memory allocated by the
1791    /// # // native sqlite library, which miri cannot track provenance for.
1792    /// # #[cfg(miri)]
1793    /// # fn main() {}
1794    /// # #[cfg(not(miri))]
1795    /// # fn main() {
1796    /// #     #[cfg(feature = "serde_json")]
1797    /// #     run_test().unwrap();
1798    /// # }
1799    /// #
1800    /// # #[cfg(feature = "serde_json")]
1801    /// # fn run_test() -> QueryResult<()> {
1802    /// #     use diesel::dsl::*;
1803    /// #     use diesel::sql_types::{Text, Integer};
1804    /// #     use serde_json::json;
1805    /// #
1806    /// #     let connection = &mut establish_connection();
1807    /// #     assert_version!(connection, 3, 45, 0);
1808    /// #
1809    /// let result = diesel::select(jsonb_object_0()).get_result::<serde_json::Value>(connection)?;
1810    /// assert_eq!(json!({}), result);
1811    ///
1812    /// let result = diesel::select(jsonb_object_1::<Text, Integer, _, _>("a", 2))
1813    ///     .get_result::<serde_json::Value>(connection)?;
1814    /// assert_eq!(json!({"a": 2}), result);
1815    ///
1816    /// let result = diesel::select(
1817    ///     jsonb_object_2::<Text, Integer, Text, Text, _, _, _, _>("a", 2, "c", "{e:5}")
1818    /// )
1819    /// .get_result::<serde_json::Value>(connection)?;
1820    /// assert_eq!(json!({"a": 2, "c": "{e:5}"}), result);
1821    /// #
1822    /// # Ok(())
1823    /// # }
1824    /// ```
1825    #[cfg(feature = "__sqlite-shared")]
1826    #[variadic(2)]
1827    fn jsonb_object<K: NotBlob<IsNull = is_nullable::NotNull>, V: NotBlob>(
1828        key: K,
1829        value: V,
1830    ) -> Jsonb;
1831
1832    /// The json_group_object(NAME,VALUE) function returns a JSON object comprised of all NAME/VALUE pairs in
1833    /// the aggregation.
1834    ///
1835    /// A potential edge case in this function arises when `names` contains duplicate elements.
1836    /// In such case, the result will include all duplicates (e.g., `{"key": 1, "key": 2, "key": 3}`).
1837    /// Note that any duplicate entries in the resulting JSON will be removed during deserialization.
1838    ///
1839    /// This function requires at least SQLite 3.38 or newer
1840    ///
1841    /// ## Aggregate Function Expression
1842    ///
1843    /// This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details.
1844    ///
1845    /// # Examples
1846    ///
1847    /// ## Normal function usage
1848    ///
1849    /// ```rust
1850    /// # include!("../../doctest_setup.rs");
1851    /// #
1852    /// # // Reading the query result requires reading memory allocated by the
1853    /// # // native sqlite library, which miri cannot track provenance for.
1854    /// # #[cfg(miri)]
1855    /// # fn main() {}
1856    /// # #[cfg(not(miri))]
1857    /// # fn main() {
1858    /// #     #[cfg(feature = "serde_json")]
1859    /// #     run_test().unwrap();
1860    /// # }
1861    /// #
1862    /// # #[cfg(feature = "serde_json")]
1863    /// # fn run_test() -> QueryResult<()> {
1864    /// #     use diesel::dsl::*;
1865    /// #     use diesel::sql_types::Text;
1866    /// #     use serde_json::json;
1867    /// #     use schema::animals::dsl::*;
1868    /// #
1869    /// #     let connection = &mut establish_connection();
1870    /// #     assert_version!(connection, 3, 38, 0);
1871    /// #
1872    /// let result = animals.select(json_group_object(species, name)).get_result::<serde_json::Value>(connection)?;
1873    /// assert_eq!(json!({"dog":"Jack","spider":null}), result);
1874    /// #
1875    /// # Ok(())
1876    /// # }
1877    /// ```
1878    ///
1879    /// ## Aggregate function expression
1880    ///
1881    /// ```rust
1882    /// # include!("../../doctest_setup.rs");
1883    /// #
1884    /// # // Reading the query result requires reading memory allocated by the
1885    /// # // native sqlite library, which miri cannot track provenance for.
1886    /// # #[cfg(miri)]
1887    /// # fn main() {}
1888    /// # #[cfg(not(miri))]
1889    /// # fn main() {
1890    /// #     #[cfg(feature = "serde_json")]
1891    /// #     run_test().unwrap();
1892    /// # }
1893    /// #
1894    /// # #[cfg(feature = "serde_json")]
1895    /// # fn run_test() -> QueryResult<()> {
1896    /// #     use diesel::dsl::*;
1897    /// #     use diesel::sql_types::Text;
1898    /// #     use serde_json::json;
1899    /// #     use schema::animals::dsl::*;
1900    /// #
1901    /// #     let connection = &mut establish_connection();
1902    /// #     assert_version!(connection, 3, 38, 0);
1903    /// #
1904    /// let result = animals.select(json_group_object(species, name).aggregate_filter(legs.lt(8))).get_result::<serde_json::Value>(connection)?;
1905    /// assert_eq!(json!({"dog":"Jack"}), result);
1906    /// #
1907    /// # Ok(())
1908    /// # }
1909    /// ```
1910    ///
1911    /// # See also
1912    /// - [`jsonb_group_object`](jsonb_group_object()) will return data in JSONB format instead of JSON.
1913    /// - [`json_group_array`](json_group_array()) will return JSON array instead of object.
1914    #[cfg(feature = "__sqlite-shared")]
1915    #[aggregate]
1916    fn json_group_object<
1917        N: SqlType<IsNull = is_nullable::NotNull> + SingleValue,
1918        V: SqlType + SingleValue,
1919    >(
1920        names: N,
1921        values: V,
1922    ) -> Json;
1923
1924    /// The jsonb_group_object(NAME,VALUE) function returns a JSONB object comprised of all NAME/VALUE pairs in
1925    /// the aggregation.
1926    ///
1927    /// A potential edge case in this function arises when `names` contains duplicate elements.
1928    /// In such case, the result will include all duplicates (e.g., `{"key": 1, "key": 2, "key": 3}`).
1929    /// Note that any duplicate entries in the resulting JSONB will be removed during deserialization.
1930    ///
1931    /// This function requires at least SQLite 3.45 or newer
1932    ///
1933    /// ## Aggregate Function Expression
1934    ///
1935    /// This function can be used as aggregate expression. See [`AggregateExpressionMethods`] for details.
1936    ///
1937    /// # Examples
1938    ///
1939    /// ## Normal function usage
1940    ///
1941    /// ```rust
1942    /// # include!("../../doctest_setup.rs");
1943    /// #
1944    /// # // Reading the query result requires reading memory allocated by the
1945    /// # // native sqlite library, which miri cannot track provenance for.
1946    /// # #[cfg(miri)]
1947    /// # fn main() {}
1948    /// # #[cfg(not(miri))]
1949    /// # fn main() {
1950    /// #     #[cfg(feature = "serde_json")]
1951    /// #     run_test().unwrap();
1952    /// # }
1953    /// #
1954    /// # #[cfg(feature = "serde_json")]
1955    /// # fn run_test() -> QueryResult<()> {
1956    /// #     use diesel::dsl::*;
1957    /// #     use serde_json::json;
1958    /// #     use schema::animals::dsl::*;
1959    /// #
1960    /// #     let connection = &mut establish_connection();
1961    /// #     assert_version!(connection, 3, 45, 0);
1962    /// #
1963    /// let result = animals.select(jsonb_group_object(species, name)).get_result::<serde_json::Value>(connection)?;
1964    /// assert_eq!(json!({"dog":"Jack","spider":null}), result);
1965    /// #
1966    /// # Ok(())
1967    /// # }
1968    /// ```
1969    ///
1970    /// ## Aggregate function expression
1971    ///
1972    /// ```rust
1973    /// # include!("../../doctest_setup.rs");
1974    /// #
1975    /// # // Reading the query result requires reading memory allocated by the
1976    /// # // native sqlite library, which miri cannot track provenance for.
1977    /// # #[cfg(miri)]
1978    /// # fn main() {}
1979    /// # #[cfg(not(miri))]
1980    /// # fn main() {
1981    /// #     #[cfg(feature = "serde_json")]
1982    /// #     run_test().unwrap();
1983    /// # }
1984    /// #
1985    /// # #[cfg(feature = "serde_json")]
1986    /// # fn run_test() -> QueryResult<()> {
1987    /// #     use diesel::dsl::*;
1988    /// #     use serde_json::json;
1989    /// #     use schema::animals::dsl::*;
1990    /// #
1991    /// #     let connection = &mut establish_connection();
1992    /// #     assert_version!(connection, 3, 45, 0);
1993    /// #
1994    /// let result = animals.select(jsonb_group_object(species, name).aggregate_filter(legs.lt(8))).get_result::<serde_json::Value>(connection)?;
1995    /// assert_eq!(json!({"dog":"Jack"}), result);
1996    /// #
1997    /// # Ok(())
1998    /// # }
1999    /// ```
2000    ///
2001    /// # See also
2002    /// - [`json_group_object`](json_group_object()) will return data in JSON format instead of JSONB.
2003    /// - [`jsonb_group_array`](jsonb_group_array()) will return JSONB array instead of object.
2004    #[cfg(feature = "__sqlite-shared")]
2005    #[aggregate]
2006    fn jsonb_group_object<
2007        N: SqlType<IsNull = is_nullable::NotNull> + SingleValue,
2008        V: SqlType + SingleValue,
2009    >(
2010        names: N,
2011        values: V,
2012    ) -> Jsonb;
2013
2014    /// The `json_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array
2015    /// that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this
2016    /// function.
2017    ///
2018    /// An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the
2019    /// argument is the output from another json function, then it is stored as JSON. This allows calls to
2020    /// `json_array()` and `json_object()` to be nested. The [`json()`] function can also be used to force
2021    /// strings to be recognized as JSON.
2022    ///
2023    /// This function requires at least SQLite 3.38 or newer
2024    ///
2025    /// # Examples
2026    ///
2027    /// ```rust
2028    /// # include!("../../doctest_setup.rs");
2029    /// #
2030    /// # // Reading the query result requires reading memory allocated by the
2031    /// # // native sqlite library, which miri cannot track provenance for.
2032    /// # #[cfg(miri)]
2033    /// # fn main() {}
2034    /// # #[cfg(not(miri))]
2035    /// # fn main() {
2036    /// #     #[cfg(feature = "serde_json")]
2037    /// #     run_test().unwrap();
2038    /// # }
2039    /// #
2040    /// # #[cfg(feature = "serde_json")]
2041    /// # fn run_test() -> QueryResult<()> {
2042    /// #     use diesel::dsl::*;
2043    /// #     use diesel::sql_types::{Text, Double};
2044    /// #     use serde_json::json;
2045    /// #
2046    /// #     let connection = &mut establish_connection();
2047    /// #     assert_version!(connection, 3, 38, 0);
2048    /// #
2049    /// let result = diesel::select(json_array_0()).get_result::<serde_json::Value>(connection)?;
2050    /// assert_eq!(json!([]), result);
2051    ///
2052    /// let result = diesel::select(json_array_1::<Text, _>("abc"))
2053    ///     .get_result::<serde_json::Value>(connection)?;
2054    /// assert_eq!(json!(["abc"]), result);
2055    ///
2056    /// let result = diesel::select(json_array_2::<Text, Double, _, _>("abc", 3.1415))
2057    ///     .get_result::<serde_json::Value>(connection)?;
2058    /// assert_eq!(json!(["abc", 3.1415]), result);
2059    /// #
2060    /// # Ok(())
2061    /// # }
2062    /// ```
2063    #[cfg(feature = "__sqlite-shared")]
2064    #[variadic(1)]
2065    fn json_array<V: NotBlob>(value: V) -> Json;
2066
2067    /// The `jsonb_array()` SQL function accepts zero or more arguments and returns a well-formed JSON array
2068    /// that is composed from those arguments. Note that arguments of type BLOB will not be accepted by this
2069    /// function.
2070    ///
2071    /// An argument with SQL type TEXT is normally converted into a quoted JSON string. However, if the
2072    /// argument is the output from another json function, then it is stored as JSON. This allows calls to
2073    /// `jsonb_array()` and `jsonb_object()` to be nested. The [`json()`] function can also be used to force
2074    /// strings to be recognized as JSON.
2075    ///
2076    /// This function works just like the [`json_array()`](json_array_1()) function except that it returns the
2077    /// constructed JSON array in the SQLite's private JSONB format rather than in the standard RFC 8259 text
2078    /// format.
2079    ///
2080    /// This function requires at least SQLite 3.45 or newer
2081    ///
2082    /// # Examples
2083    ///
2084    /// ```rust
2085    /// # include!("../../doctest_setup.rs");
2086    /// #
2087    /// # // Reading the query result requires reading memory allocated by the
2088    /// # // native sqlite library, which miri cannot track provenance for.
2089    /// # #[cfg(miri)]
2090    /// # fn main() {}
2091    /// # #[cfg(not(miri))]
2092    /// # fn main() {
2093    /// #     #[cfg(feature = "serde_json")]
2094    /// #     run_test().unwrap();
2095    /// # }
2096    /// #
2097    /// # #[cfg(feature = "serde_json")]
2098    /// # fn run_test() -> QueryResult<()> {
2099    /// #     use diesel::dsl::*;
2100    /// #     use diesel::sql_types::{Text, Double};
2101    /// #     use serde_json::json;
2102    /// #
2103    /// #     let connection = &mut establish_connection();
2104    /// #     assert_version!(connection, 3, 45, 0);
2105    /// #
2106    /// let result = diesel::select(jsonb_array_0()).get_result::<serde_json::Value>(connection)?;
2107    /// assert_eq!(json!([]), result);
2108    ///
2109    /// let result = diesel::select(jsonb_array_1::<Text, _>("abc"))
2110    ///     .get_result::<serde_json::Value>(connection)?;
2111    /// assert_eq!(json!(["abc"]), result);
2112    ///
2113    /// let result = diesel::select(jsonb_array_2::<Text, Double, _, _>("abc", 3.1415))
2114    ///     .get_result::<serde_json::Value>(connection)?;
2115    /// assert_eq!(json!(["abc", 3.1415]), result);
2116    /// #
2117    /// # Ok(())
2118    /// # }
2119    /// ```
2120    #[cfg(feature = "__sqlite-shared")]
2121    #[variadic(1)]
2122    fn jsonb_array<V: NotBlob>(value: V) -> Jsonb;
2123
2124    /// The `json_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by
2125    /// zero or more path arguments. The `json_remove(X,P,...)` function returns a copy of the X parameter
2126    /// with all the elements identified by path arguments removed. Paths that select elements not found in X
2127    /// are silently ignored.
2128    ///
2129    /// Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path
2130    /// search for subsequent arguments.
2131    ///
2132    /// If the `json_remove(X)` function is called with no path arguments, then it returns the input X
2133    /// reformatted, with excess whitespace removed.
2134    ///
2135    /// The `json_remove()` function throws an error if any of the path arguments is not a well-formed path.
2136    ///
2137    /// This function requires at least SQLite 3.38 or newer
2138    ///
2139    /// # Examples
2140    ///
2141    /// ```rust
2142    /// # include!("../../doctest_setup.rs");
2143    /// #
2144    /// # // Reading the query result requires reading memory allocated by the
2145    /// # // native sqlite library, which miri cannot track provenance for.
2146    /// # #[cfg(miri)]
2147    /// # fn main() {}
2148    /// # #[cfg(not(miri))]
2149    /// # fn main() {
2150    /// #     #[cfg(feature = "serde_json")]
2151    /// #     run_test().unwrap();
2152    /// # }
2153    /// #
2154    /// # #[cfg(feature = "serde_json")]
2155    /// # fn run_test() -> QueryResult<()> {
2156    /// #     use diesel::dsl::*;
2157    /// #     use diesel::sql_types::{Json, Text};
2158    /// #     use serde_json::json;
2159    /// #
2160    /// #     let connection = &mut establish_connection();
2161    /// #     assert_version!(connection, 3, 38, 0);
2162    /// #
2163    /// let json = json!(['a', 'b', 'c', 'd']);
2164    /// let result = diesel::select(json_remove_0::<Json, _>(json))
2165    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2166    /// assert_eq!(Some(json!(['a', 'b', 'c', 'd'])), result);
2167    ///
2168    /// // Values are removed sequentially from left to right.
2169    /// let json = json!(['a', 'b', 'c', 'd']);
2170    /// let result = diesel::select(json_remove_2::<Json, _, _, _>(json, "$[0]", "$[2]"))
2171    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2172    /// assert_eq!(Some(json!(['b', 'c'])), result);
2173    ///
2174    /// let json = json!({"a": 10, "b": 20});
2175    /// let result = diesel::select(json_remove_1::<Json, _, _>(json, "$.a"))
2176    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2177    /// assert_eq!(Some(json!({"b": 20})), result);
2178    ///
2179    /// // Paths that select not existing elements are silently ignored.
2180    /// let json = json!({"a": 10, "b": 20});
2181    /// let result = diesel::select(json_remove_1::<Json, _, _>(json, "$.c"))
2182    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2183    /// assert_eq!(Some(json!({"a": 10, "b": 20})), result);
2184    ///
2185    /// let json = json!({"a": 10, "b": 20});
2186    /// let result = diesel::select(json_remove_1::<Json, _, _>(json, "$"))
2187    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2188    /// assert_eq!(None, result);
2189    ///
2190    /// #
2191    /// # Ok(())
2192    /// # }
2193    /// ```
2194    #[cfg(feature = "__sqlite-shared")]
2195    #[variadic(1)]
2196    fn json_remove<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
2197        json: J,
2198        path: Text,
2199    ) -> Nullable<Json>;
2200
2201    /// The `jsonb_remove(X,P,...)` SQL function takes a single JSON value as its first argument followed by
2202    /// zero or more path arguments. The `jsonb_remove(X,P,...)` function returns a copy of the X parameter
2203    /// with all the elements identified by path arguments removed. Paths that select elements not found in X
2204    /// are silently ignored.
2205    ///
2206    /// Removals occurs sequentially from left to right. Changes caused by prior removals can affect the path
2207    /// search for subsequent arguments.
2208    ///
2209    /// If the `jsonb_remove(X)` function is called with no path arguments, then it returns the input X
2210    /// reformatted, with excess whitespace removed.
2211    ///
2212    /// The `jsonb_remove()` function throws an error if any of the path arguments is not a well-formed path.
2213    ///
2214    /// This function returns value in a binary JSONB format.
2215    ///
2216    /// This function requires at least SQLite 3.45 or newer
2217    ///
2218    /// # Examples
2219    ///
2220    /// ```rust
2221    /// # include!("../../doctest_setup.rs");
2222    /// #
2223    /// # // Reading the query result requires reading memory allocated by the
2224    /// # // native sqlite library, which miri cannot track provenance for.
2225    /// # #[cfg(miri)]
2226    /// # fn main() {}
2227    /// # #[cfg(not(miri))]
2228    /// # fn main() {
2229    /// #     #[cfg(feature = "serde_json")]
2230    /// #     run_test().unwrap();
2231    /// # }
2232    /// #
2233    /// # #[cfg(feature = "serde_json")]
2234    /// # fn run_test() -> QueryResult<()> {
2235    /// #     use diesel::dsl::*;
2236    /// #     use diesel::sql_types::{Jsonb, Text};
2237    /// #     use serde_json::json;
2238    /// #
2239    /// #     let connection = &mut establish_connection();
2240    /// #     assert_version!(connection, 3, 45, 0);
2241    /// #
2242    /// let json = json!(['a', 'b', 'c', 'd']);
2243    /// let result = diesel::select(jsonb_remove_0::<Jsonb, _>(json))
2244    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2245    /// assert_eq!(Some(json!(['a', 'b', 'c', 'd'])), result);
2246    ///
2247    /// // Values are removed sequentially from left to right.
2248    /// let json = json!(['a', 'b', 'c', 'd']);
2249    /// let result = diesel::select(jsonb_remove_2::<Jsonb, _, _, _>(json, "$[0]", "$[2]"))
2250    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2251    /// assert_eq!(Some(json!(['b', 'c'])), result);
2252    ///
2253    /// let json = json!({"a": 10, "b": 20});
2254    /// let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, "$.a"))
2255    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2256    /// assert_eq!(Some(json!({"b": 20})), result);
2257    ///
2258    /// // Paths that select not existing elements are silently ignored.
2259    /// let json = json!({"a": 10, "b": 20});
2260    /// let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, "$.c"))
2261    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2262    /// assert_eq!(Some(json!({"a": 10, "b": 20})), result);
2263    ///
2264    /// let json = json!({"a": 10, "b": 20});
2265    /// let result = diesel::select(jsonb_remove_1::<Jsonb, _, _>(json, "$"))
2266    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2267    /// assert_eq!(None, result);
2268    ///
2269    /// #
2270    /// # Ok(())
2271    /// # }
2272    /// ```
2273    #[cfg(feature = "__sqlite-shared")]
2274    #[variadic(1)]
2275    fn jsonb_remove<J: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue>(
2276        json: J,
2277        path: Text,
2278    ) -> Nullable<Jsonb>;
2279
2280    /// The `json_insert(X,P,V,...)` SQL function takes a single JSON value as its first argument
2281    /// followed by zero or more pairs of path and value arguments. It returns a copy of the X
2282    /// argument with the values V inserted at the paths P, but only where nothing already exists at
2283    /// the path. Paths that already select an element of X are left unchanged.
2284    ///
2285    /// The path/value pairs are applied sequentially from left to right.
2286    ///
2287    /// A path that ends in `[#]` appends the value to an existing array.
2288    ///
2289    /// If the `json_insert(X)` function is called with no path/value pairs, then it returns the
2290    /// input X reformatted, with excess whitespace removed.
2291    ///
2292    /// The `json_insert()` function throws an error if any of the path arguments is not a
2293    /// well-formed path.
2294    ///
2295    /// This function requires at least SQLite 3.38 or newer
2296    ///
2297    /// # Examples
2298    ///
2299    /// ```rust
2300    /// # include!("../../doctest_setup.rs");
2301    /// #
2302    /// # // Reading the query result requires reading memory allocated by the
2303    /// # // native sqlite library, which miri cannot track provenance for.
2304    /// # #[cfg(miri)]
2305    /// # fn main() {}
2306    /// # #[cfg(not(miri))]
2307    /// # fn main() {
2308    /// #     #[cfg(feature = "serde_json")]
2309    /// #     run_test().unwrap();
2310    /// # }
2311    /// #
2312    /// # #[cfg(feature = "serde_json")]
2313    /// # fn run_test() -> QueryResult<()> {
2314    /// #     use diesel::dsl::*;
2315    /// #     use diesel::sql_types::{Integer, Json, Text, Nullable};
2316    /// #     use serde_json::json;
2317    /// #
2318    /// #     let connection = &mut establish_connection();
2319    /// #     assert_version!(connection, 3, 38, 0);
2320    /// #
2321    /// let json = json!({"a": 1, "c": 3});
2322    /// let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, "$.b", 2))
2323    ///     .get_result::<serde_json::Value>(connection)?;
2324    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2325    ///
2326    /// // A path that already exists is left unchanged.
2327    /// let json = json!({"a": 1});
2328    /// let result = diesel::select(json_insert_1::<Json, Integer, _, _, _>(json, "$.a", 99))
2329    ///     .get_result::<serde_json::Value>(connection)?;
2330    /// assert_eq!(json!({"a": 1}), result);
2331    ///
2332    /// // A path ending in "[#]" appends to an array.
2333    /// let json = json!(['a', 'b', 'c']);
2334    /// let result = diesel::select(json_insert_1::<Json, Text, _, _, _>(json, "$[#]", "d"))
2335    ///     .get_result::<serde_json::Value>(connection)?;
2336    /// assert_eq!(json!(['a', 'b', 'c', 'd']), result);
2337    ///
2338    /// let json = json!({"a": 1});
2339    /// let result = diesel::select(
2340    ///     json_insert_2::<Json, Integer, Integer, _, _, _, _, _>(json, "$.b", 2, "$.c", 3),
2341    /// )
2342    /// .get_result::<serde_json::Value>(connection)?;
2343    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2344    ///
2345    /// let json = json!({"a": 1});
2346    /// let result = diesel::select(json_insert_0::<Json, _>(json))
2347    ///     .get_result::<serde_json::Value>(connection)?;
2348    /// assert_eq!(json!({"a": 1}), result);
2349    ///
2350    /// let result = diesel::select(json_insert_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, "$.b", 1))
2351    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2352    /// assert_eq!(result, None);
2353    /// #
2354    /// # Ok(())
2355    /// # }
2356    /// ```
2357    #[cfg(feature = "__sqlite-shared")]
2358    #[variadic(2)]
2359    fn json_insert<
2360        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Json> + SingleValue,
2361        V: NotBlob,
2362    >(
2363        json: J,
2364        path: Text,
2365        value: V,
2366    ) -> J::Out;
2367
2368    /// The `jsonb_insert(X,P,V,...)` SQL function works just like the [`json_insert()`](json_insert_1())
2369    /// function except that the result is returned in SQLite's private binary JSONB format rather than
2370    /// in the standard RFC 8259 text format.
2371    ///
2372    /// This function requires at least SQLite 3.45 or newer
2373    ///
2374    /// # Examples
2375    ///
2376    /// ```rust
2377    /// # include!("../../doctest_setup.rs");
2378    /// #
2379    /// # // Reading the query result requires reading memory allocated by the
2380    /// # // native sqlite library, which miri cannot track provenance for.
2381    /// # #[cfg(miri)]
2382    /// # fn main() {}
2383    /// # #[cfg(not(miri))]
2384    /// # fn main() {
2385    /// #     #[cfg(feature = "serde_json")]
2386    /// #     run_test().unwrap();
2387    /// # }
2388    /// #
2389    /// # #[cfg(feature = "serde_json")]
2390    /// # fn run_test() -> QueryResult<()> {
2391    /// #     use diesel::dsl::*;
2392    /// #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};
2393    /// #     use serde_json::json;
2394    /// #
2395    /// #     let connection = &mut establish_connection();
2396    /// #     assert_version!(connection, 3, 45, 0);
2397    /// #
2398    /// let json = json!({"a": 1, "c": 3});
2399    /// let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, "$.b", 2))
2400    ///     .get_result::<serde_json::Value>(connection)?;
2401    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2402    ///
2403    /// // A path that already exists is left unchanged.
2404    /// let json = json!({"a": 1});
2405    /// let result = diesel::select(jsonb_insert_1::<Jsonb, Integer, _, _, _>(json, "$.a", 99))
2406    ///     .get_result::<serde_json::Value>(connection)?;
2407    /// assert_eq!(json!({"a": 1}), result);
2408    ///
2409    /// // A path ending in "[#]" appends to an array.
2410    /// let json = json!(['a', 'b', 'c']);
2411    /// let result = diesel::select(jsonb_insert_1::<Jsonb, Text, _, _, _>(json, "$[#]", "d"))
2412    ///     .get_result::<serde_json::Value>(connection)?;
2413    /// assert_eq!(json!(['a', 'b', 'c', 'd']), result);
2414    ///
2415    /// let json = json!({"a": 1});
2416    /// let result = diesel::select(
2417    ///     jsonb_insert_2::<Jsonb, Integer, Integer, _, _, _, _, _>(json, "$.b", 2, "$.c", 3),
2418    /// )
2419    /// .get_result::<serde_json::Value>(connection)?;
2420    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2421    ///
2422    /// let json = json!({"a": 1});
2423    /// let result = diesel::select(jsonb_insert_0::<Jsonb, _>(json))
2424    ///     .get_result::<serde_json::Value>(connection)?;
2425    /// assert_eq!(json!({"a": 1}), result);
2426    ///
2427    /// let result = diesel::select(jsonb_insert_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, "$.b", 1))
2428    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2429    /// assert_eq!(result, None);
2430    /// #
2431    /// # Ok(())
2432    /// # }
2433    /// ```
2434    #[cfg(feature = "__sqlite-shared")]
2435    #[variadic(2)]
2436    fn jsonb_insert<
2437        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Jsonb> + SingleValue,
2438        V: NotBlob,
2439    >(
2440        json: J,
2441        path: Text,
2442        value: V,
2443    ) -> J::Out;
2444
2445    /// The `json_replace(X,P,V,...)` SQL function takes a single JSON value as its first argument
2446    /// followed by zero or more pairs of path and value arguments. It returns a copy of the X
2447    /// argument with values V substituted at the paths P, but only where something already exists
2448    /// at the path. Paths that select elements not found in X are silently ignored.
2449    ///
2450    /// The path/value pairs are applied sequentially from left to right.
2451    ///
2452    /// If the `json_replace(X)` function is called with no path/value pairs, then it returns the
2453    /// input X reformatted, with excess whitespace removed.
2454    ///
2455    /// The `json_replace()` function throws an error if any of the path arguments is not a
2456    /// well-formed path.
2457    ///
2458    /// This function requires at least SQLite 3.38 or newer
2459    ///
2460    /// # Examples
2461    ///
2462    /// ```rust
2463    /// # include!("../../doctest_setup.rs");
2464    /// #
2465    /// # // Reading the query result requires reading memory allocated by the
2466    /// # // native sqlite library, which miri cannot track provenance for.
2467    /// # #[cfg(miri)]
2468    /// # fn main() {}
2469    /// # #[cfg(not(miri))]
2470    /// # fn main() {
2471    /// #     #[cfg(feature = "serde_json")]
2472    /// #     run_test().unwrap();
2473    /// # }
2474    /// #
2475    /// # #[cfg(feature = "serde_json")]
2476    /// # fn run_test() -> QueryResult<()> {
2477    /// #     use diesel::dsl::*;
2478    /// #     use diesel::sql_types::{Integer, Json, Text, Nullable};
2479    /// #     use serde_json::json;
2480    /// #
2481    /// #     let connection = &mut establish_connection();
2482    /// #     assert_version!(connection, 3, 38, 0);
2483    /// #
2484    /// let json = json!({"a": 1, "b": 2});
2485    /// let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, "$.a", 99))
2486    ///     .get_result::<serde_json::Value>(connection)?;
2487    /// assert_eq!(json!({"a": 99, "b": 2}), result);
2488    ///
2489    /// // A path that does not exist is silently ignored.
2490    /// let json = json!({"a": 1});
2491    /// let result = diesel::select(json_replace_1::<Json, Integer, _, _, _>(json, "$.b", 2))
2492    ///     .get_result::<serde_json::Value>(connection)?;
2493    /// assert_eq!(json!({"a": 1}), result);
2494    ///
2495    /// let json = json!({"a": 1, "b": 2});
2496    /// let result = diesel::select(
2497    ///     json_replace_2::<Json, Integer, Text, _, _, _, _, _>(json, "$.a", 99, "$.b", "x"),
2498    /// )
2499    /// .get_result::<serde_json::Value>(connection)?;
2500    /// assert_eq!(json!({"a": 99, "b": "x"}), result);
2501    ///
2502    /// let json = json!({"a": 1});
2503    /// let result = diesel::select(json_replace_0::<Json, _>(json))
2504    ///     .get_result::<serde_json::Value>(connection)?;
2505    /// assert_eq!(json!({"a": 1}), result);
2506    ///
2507    /// let result = diesel::select(json_replace_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, "$.a", 1))
2508    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2509    /// assert_eq!(result, None);
2510    /// #
2511    /// # Ok(())
2512    /// # }
2513    /// ```
2514    #[cfg(feature = "__sqlite-shared")]
2515    #[variadic(2)]
2516    fn json_replace<
2517        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Json> + SingleValue,
2518        V: NotBlob,
2519    >(
2520        json: J,
2521        path: Text,
2522        value: V,
2523    ) -> J::Out;
2524
2525    /// The `jsonb_replace(X,P,V,...)` SQL function works just like the [`json_replace()`](json_replace_1())
2526    /// function except that the result is returned in SQLite's private binary JSONB format rather than
2527    /// in the standard RFC 8259 text format.
2528    ///
2529    /// This function requires at least SQLite 3.45 or newer
2530    ///
2531    /// # Examples
2532    ///
2533    /// ```rust
2534    /// # include!("../../doctest_setup.rs");
2535    /// #
2536    /// # // Reading the query result requires reading memory allocated by the
2537    /// # // native sqlite library, which miri cannot track provenance for.
2538    /// # #[cfg(miri)]
2539    /// # fn main() {}
2540    /// # #[cfg(not(miri))]
2541    /// # fn main() {
2542    /// #     #[cfg(feature = "serde_json")]
2543    /// #     run_test().unwrap();
2544    /// # }
2545    /// #
2546    /// # #[cfg(feature = "serde_json")]
2547    /// # fn run_test() -> QueryResult<()> {
2548    /// #     use diesel::dsl::*;
2549    /// #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};
2550    /// #     use serde_json::json;
2551    /// #
2552    /// #     let connection = &mut establish_connection();
2553    /// #     assert_version!(connection, 3, 45, 0);
2554    /// #
2555    /// let json = json!({"a": 1, "b": 2});
2556    /// let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, "$.a", 99))
2557    ///     .get_result::<serde_json::Value>(connection)?;
2558    /// assert_eq!(json!({"a": 99, "b": 2}), result);
2559    ///
2560    /// // A path that does not exist is silently ignored.
2561    /// let json = json!({"a": 1});
2562    /// let result = diesel::select(jsonb_replace_1::<Jsonb, Integer, _, _, _>(json, "$.b", 2))
2563    ///     .get_result::<serde_json::Value>(connection)?;
2564    /// assert_eq!(json!({"a": 1}), result);
2565    ///
2566    /// let json = json!({"a": 1});
2567    /// let result = diesel::select(jsonb_replace_0::<Jsonb, _>(json))
2568    ///     .get_result::<serde_json::Value>(connection)?;
2569    /// assert_eq!(json!({"a": 1}), result);
2570    ///
2571    /// let result = diesel::select(jsonb_replace_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, "$.a", 1))
2572    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2573    /// assert_eq!(result, None);
2574    /// #
2575    /// # Ok(())
2576    /// # }
2577    /// ```
2578    #[cfg(feature = "__sqlite-shared")]
2579    #[variadic(2)]
2580    fn jsonb_replace<
2581        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Jsonb> + SingleValue,
2582        V: NotBlob,
2583    >(
2584        json: J,
2585        path: Text,
2586        value: V,
2587    ) -> J::Out;
2588
2589    /// The `json_set(X,P,V,...)` SQL function takes a single JSON value as its first argument
2590    /// followed by zero or more pairs of path and value arguments. It returns a copy of the X
2591    /// argument with values V inserted or replaced at the paths P. Unlike [`json_replace()`](json_replace_1()),
2592    /// `json_set()` also inserts new values where the path does not already exist.
2593    ///
2594    /// The path/value pairs are applied sequentially from left to right.
2595    ///
2596    /// A path that ends in `[#]` appends the value to an existing array.
2597    ///
2598    /// If the `json_set(X)` function is called with no path/value pairs, then it returns the
2599    /// input X reformatted, with excess whitespace removed.
2600    ///
2601    /// The `json_set()` function throws an error if any of the path arguments is not a
2602    /// well-formed path.
2603    ///
2604    /// This function requires at least SQLite 3.38 or newer
2605    ///
2606    /// # Examples
2607    ///
2608    /// ```rust
2609    /// # include!("../../doctest_setup.rs");
2610    /// #
2611    /// # // Reading the query result requires reading memory allocated by the
2612    /// # // native sqlite library, which miri cannot track provenance for.
2613    /// # #[cfg(miri)]
2614    /// # fn main() {}
2615    /// # #[cfg(not(miri))]
2616    /// # fn main() {
2617    /// #     #[cfg(feature = "serde_json")]
2618    /// #     run_test().unwrap();
2619    /// # }
2620    /// #
2621    /// # #[cfg(feature = "serde_json")]
2622    /// # fn run_test() -> QueryResult<()> {
2623    /// #     use diesel::dsl::*;
2624    /// #     use diesel::sql_types::{Integer, Json, Text, Nullable};
2625    /// #     use serde_json::json;
2626    /// #
2627    /// #     let connection = &mut establish_connection();
2628    /// #     assert_version!(connection, 3, 38, 0);
2629    /// #
2630    /// let json = json!({"a": 1});
2631    /// let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, "$.b", 2))
2632    ///     .get_result::<serde_json::Value>(connection)?;
2633    /// assert_eq!(json!({"a": 1, "b": 2}), result);
2634    ///
2635    /// // Existing values are replaced.
2636    /// let json = json!({"a": 1});
2637    /// let result = diesel::select(json_set_1::<Json, Integer, _, _, _>(json, "$.a", 99))
2638    ///     .get_result::<serde_json::Value>(connection)?;
2639    /// assert_eq!(json!({"a": 99}), result);
2640    ///
2641    /// // A path ending in "[#]" appends to an array.
2642    /// let json = json!(['a', 'b', 'c']);
2643    /// let result = diesel::select(json_set_1::<Json, Text, _, _, _>(json, "$[#]", "d"))
2644    ///     .get_result::<serde_json::Value>(connection)?;
2645    /// assert_eq!(json!(['a', 'b', 'c', 'd']), result);
2646    ///
2647    /// let json = json!({"a": 1});
2648    /// let result = diesel::select(
2649    ///     json_set_2::<Json, Integer, Integer, _, _, _, _, _>(json, "$.b", 2, "$.c", 3),
2650    /// )
2651    /// .get_result::<serde_json::Value>(connection)?;
2652    /// assert_eq!(json!({"a": 1, "b": 2, "c": 3}), result);
2653    ///
2654    /// let json = json!({"a": 1});
2655    /// let result = diesel::select(json_set_0::<Json, _>(json))
2656    ///     .get_result::<serde_json::Value>(connection)?;
2657    /// assert_eq!(json!({"a": 1}), result);
2658    ///
2659    /// let result = diesel::select(json_set_1::<Nullable<Json>, Integer, _, _, _>(None::<serde_json::Value>, "$.b", 1))
2660    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2661    /// assert_eq!(result, None);
2662    /// #
2663    /// # Ok(())
2664    /// # }
2665    /// ```
2666    #[cfg(feature = "__sqlite-shared")]
2667    #[variadic(2)]
2668    fn json_set<
2669        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Json> + SingleValue,
2670        V: NotBlob,
2671    >(
2672        json: J,
2673        path: Text,
2674        value: V,
2675    ) -> J::Out;
2676
2677    /// The `jsonb_set(X,P,V,...)` SQL function works just like the [`json_set()`](json_set_1())
2678    /// function except that the result is returned in SQLite's private binary JSONB format rather than
2679    /// in the standard RFC 8259 text format.
2680    ///
2681    /// This function requires at least SQLite 3.45 or newer
2682    ///
2683    /// # Examples
2684    ///
2685    /// ```rust
2686    /// # include!("../../doctest_setup.rs");
2687    /// #
2688    /// # // Reading the query result requires reading memory allocated by the
2689    /// # // native sqlite library, which miri cannot track provenance for.
2690    /// # #[cfg(miri)]
2691    /// # fn main() {}
2692    /// # #[cfg(not(miri))]
2693    /// # fn main() {
2694    /// #     #[cfg(feature = "serde_json")]
2695    /// #     run_test().unwrap();
2696    /// # }
2697    /// #
2698    /// # #[cfg(feature = "serde_json")]
2699    /// # fn run_test() -> QueryResult<()> {
2700    /// #     use diesel::dsl::*;
2701    /// #     use diesel::sql_types::{Integer, Jsonb, Text, Nullable};
2702    /// #     use serde_json::json;
2703    /// #
2704    /// #     let connection = &mut establish_connection();
2705    /// #     assert_version!(connection, 3, 45, 0);
2706    /// #
2707    /// let json = json!({"a": 1});
2708    /// let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, "$.b", 2))
2709    ///     .get_result::<serde_json::Value>(connection)?;
2710    /// assert_eq!(json!({"a": 1, "b": 2}), result);
2711    ///
2712    /// // Existing values are replaced.
2713    /// let json = json!({"a": 1});
2714    /// let result = diesel::select(jsonb_set_1::<Jsonb, Integer, _, _, _>(json, "$.a", 99))
2715    ///     .get_result::<serde_json::Value>(connection)?;
2716    /// assert_eq!(json!({"a": 99}), result);
2717    ///
2718    /// // A path ending in "[#]" appends to an array.
2719    /// let json = json!(['a', 'b', 'c']);
2720    /// let result = diesel::select(jsonb_set_1::<Jsonb, Text, _, _, _>(json, "$[#]", "d"))
2721    ///     .get_result::<serde_json::Value>(connection)?;
2722    /// assert_eq!(json!(['a', 'b', 'c', 'd']), result);
2723    ///
2724    /// let json = json!({"a": 1});
2725    /// let result = diesel::select(jsonb_set_0::<Jsonb, _>(json))
2726    ///     .get_result::<serde_json::Value>(connection)?;
2727    /// assert_eq!(json!({"a": 1}), result);
2728    ///
2729    /// let result = diesel::select(jsonb_set_1::<Nullable<Jsonb>, Integer, _, _, _>(None::<serde_json::Value>, "$.b", 1))
2730    ///     .get_result::<Option<serde_json::Value>>(connection)?;
2731    /// assert_eq!(result, None);
2732    /// #
2733    /// # Ok(())
2734    /// # }
2735    /// ```
2736    #[cfg(feature = "__sqlite-shared")]
2737    #[variadic(2)]
2738    fn jsonb_set<
2739        J: JsonOrNullableJsonOrJsonbOrNullableJsonb + MaybeNullableValue<Jsonb> + SingleValue,
2740        V: NotBlob,
2741    >(
2742        json: J,
2743        path: Text,
2744        value: V,
2745    ) -> J::Out;
2746
2747    /// Applies an RFC 7396 MergePatch `patch` to the input JSON `target` and
2748    /// returns the patched JSON value.
2749    ///
2750    /// MergePatch can add, modify, or delete elements of a JSON object. Arrays are
2751    /// treated as atomic values: they can only be inserted, replaced, or deleted as a
2752    /// whole, not modified element-wise.
2753    ///
2754    /// # Examples
2755    ///
2756    /// ```rust
2757    /// # include!("../../doctest_setup.rs");
2758    /// #
2759    /// # // Reading the query result requires reading memory allocated by the
2760    /// # // native sqlite library, which miri cannot track provenance for.
2761    /// # #[cfg(miri)]
2762    /// # fn main() {}
2763    /// # #[cfg(not(miri))]
2764    /// # fn main() {
2765    /// #     #[cfg(feature = "serde_json")]
2766    /// #     run_test().unwrap();
2767    /// # }
2768    /// #
2769    /// # #[cfg(feature = "serde_json")]
2770    /// # fn run_test() -> QueryResult<()> {
2771    /// #     use diesel::dsl::json_patch;
2772    /// #     use serde_json::{json, Value};
2773    /// #     use diesel::sql_types::{Json, Nullable};
2774    /// #     let connection = &mut establish_connection();
2775    ///
2776    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2777    ///     json!( {"a":1,"b":2} ),
2778    ///     json!( {"c":3,"d":4} ),
2779    /// ))
2780    /// .get_result::<Value>(connection)?;
2781    /// assert_eq!(json!({"a":1,"b":2,"c":3,"d":4}), result);
2782    ///
2783    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2784    ///     json!( {"a":[1,2],"b":2} ),
2785    ///     json!( {"a":9} ),
2786    /// ))
2787    /// .get_result::<Value>(connection)?;
2788    /// assert_eq!(json!({"a":9,"b":2}), result);
2789    ///
2790    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2791    ///     json!( {"a":[1,2],"b":2} ),
2792    ///     json!( {"a":null} ),
2793    /// ))
2794    /// .get_result::<Value>(connection)?;
2795    /// assert_eq!(json!({"b":2}), result);
2796    ///
2797    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2798    ///     json!( {"a":1,"b":2} ),
2799    ///     json!( {"a":9,"b":null,"c":8} ),
2800    /// ))
2801    /// .get_result::<Value>(connection)?;
2802    /// assert_eq!(json!({"a":9,"c":8}), result);
2803    ///
2804    /// let result = diesel::select(json_patch::<Json, Json, _, _>(
2805    ///     json!( {"a":{"x":1,"y":2},"b":3} ),
2806    ///     json!( {"a":{"y":9},"c":8} ),
2807    /// ))
2808    /// .get_result::<Value>(connection)?;
2809    /// assert_eq!(
2810    ///     json!({"a":{"x":1,"y":9},"b":3,"c":8}),
2811    ///     result
2812    /// );
2813    ///
2814    /// // Nullable input yields nullable output
2815    /// let result = diesel::select(json_patch::<Nullable<Json>, Json, _, _>(
2816    ///     None::<Value>,
2817    ///     json!({}),
2818    /// ))
2819    /// .get_result::<Option<Value>>(connection)?;
2820    /// assert!(result.is_none());
2821    ///
2822    /// #     Ok(())
2823    /// # }
2824    /// ```
2825    #[cfg(feature = "__sqlite-shared")]
2826    fn json_patch<
2827        T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
2828        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue + CombinedNullableValue<T, Json>,
2829    >(
2830        target: T,
2831        patch: P,
2832    ) -> P::Out;
2833
2834    /// Applies an RFC 7396 MergePatch `patch` to the input JSON `target` and
2835    /// returns the patched JSON value in SQLite's binary JSONB format.
2836    ///
2837    /// See [`json_patch`](json_patch()) for details about the MergePatch semantics.
2838    ///
2839    /// This function requires at least SQLite 3.45 or newer
2840    ///
2841    /// # Examples
2842    ///
2843    /// ```rust
2844    /// # include!("../../doctest_setup.rs");
2845    /// #
2846    /// # // Reading the query result requires reading memory allocated by the
2847    /// # // native sqlite library, which miri cannot track provenance for.
2848    /// # #[cfg(miri)]
2849    /// # fn main() {}
2850    /// # #[cfg(not(miri))]
2851    /// # fn main() {
2852    /// #     #[cfg(feature = "serde_json")]
2853    /// #     run_test().unwrap();
2854    /// # }
2855    /// #
2856    /// # #[cfg(feature = "serde_json")]
2857    /// # fn run_test() -> QueryResult<()> {
2858    /// #     use diesel::dsl::jsonb_patch;
2859    /// #     use serde_json::{json, Value};
2860    /// #     use diesel::sql_types::{Jsonb, Nullable};
2861    /// #     let connection = &mut establish_connection();
2862    /// #     assert_version!(connection, 3, 45, 0);
2863    ///
2864    /// let result = diesel::select(jsonb_patch::<Jsonb, Jsonb, _, _>(
2865    ///     json!( {"a":1,"b":2} ),
2866    ///     json!( {"c":3,"d":4} ),
2867    /// ))
2868    /// .get_result::<Value>(connection)?;
2869    /// assert_eq!(json!({"a":1,"b":2,"c":3,"d":4}), result);
2870    ///
2871    /// // Nullable input yields nullable output
2872    /// let result = diesel::select(jsonb_patch::<Nullable<Jsonb>, Jsonb, _, _>(
2873    ///     None::<Value>,
2874    ///     json!({}),
2875    /// ))
2876    /// .get_result::<Option<Value>>(connection)?;
2877    /// assert!(result.is_none());
2878    ///
2879    /// #     Ok(())
2880    /// # }
2881    /// ```
2882    #[cfg(feature = "__sqlite-shared")]
2883    fn jsonb_patch<
2884        T: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue,
2885        P: JsonOrNullableJsonOrJsonbOrNullableJsonb + SingleValue + CombinedNullableValue<T, Jsonb>,
2886    >(
2887        target: T,
2888        patch: P,
2889    ) -> P::Out;
2890}
2891
2892pub(super) mod return_type_helpers_reexported {
2893    #[allow(unused_imports)]
2894    #[doc(inline)]
2895    pub use super::return_type_helpers::*;
2896}