Skip to content

Commit

Permalink
changed type signature to fix auto_type error
Browse files Browse the repository at this point in the history
  • Loading branch information
valkrypton committed Sep 12, 2024
1 parent 24cc3fc commit ad2fb0e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions diesel/src/pg/expression/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,7 @@ define_sql_function! {
fn to_jsonb<E: MaybeNullableValue<Jsonb>>(e: E) -> E::Out;
}

#[cfg(feature = "postgres_backend")]
define_sql_function! {
/// Builds a JSON object out of a text array. The array must have an even number of members,
/// in which case they are taken as alternating key/value pairs. This function also has a form that
Expand Down
4 changes: 2 additions & 2 deletions diesel/src/pg/expression/helper_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,5 +490,5 @@ pub type json_object<A> = super::functions::json_object<SqlTypeOf<A>, A>;
/// Return type of [`json_object_with_keys_and_values(text_array, text_array)`](super::functions::json_object_with_keys_and_values())
#[allow(non_camel_case_types)]
#[cfg(feature = "postgres_backend")]
pub type json_object_with_keys_and_values<A> =
super::functions::json_object_with_keys_and_values<SqlTypeOf<A>, A, A>;
pub type json_object_with_keys_and_values<K, V> =
super::functions::json_object_with_keys_and_values<SqlTypeOf<K>, K, V>;
2 changes: 1 addition & 1 deletion diesel_derives/tests/auto_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ fn postgres_functions() -> _ {
to_json(pg_extras::id),
to_jsonb(pg_extras::id),
json_object(pg_extras::text_array),
json_object_with_keys_and_values(pg_extras::text_array),
json_object_with_keys_and_values(pg_extras::text_array, pg_extras::text_array),
)
}

Expand Down

0 comments on commit ad2fb0e

Please sign in to comment.