Skip to content

Commit

Permalink
diesel_derives: specify derive_from_sql_row() docs
Browse files Browse the repository at this point in the history
This change addresses a terminology detail that may slightly mislead
some library users. The current doc comment states that this derive
implements `Queryable` for primitive types. "Primitive type" in that
context is supposed to refer to a rust type that corresponds to a
single SQL type in contrast to a whole database row.

However, the current term unfortunately collides with Rust's definition
of "primitive types" [1] so we phrase it in a slightly more elaborate
way to prevent confusion.

[1] https://doc.rust-lang.org/rust-by-example/primitives.html
  • Loading branch information
bachmannscode committed May 19, 2024
1 parent 3c7b7c4 commit 20d9155
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diesel_derives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub fn derive_diesel_numeric_ops(input: TokenStream) -> TokenStream {
diesel_numeric_ops::derive(parse_macro_input!(input)).into()
}

/// Implements `Queryable` for primitive types
/// Implements `Queryable` for types that correspond to a single SQL type. The type must implement `FromSql`.
///
/// This derive is mostly useful to implement support deserializing
/// into rust types not supported by Diesel itself.
Expand Down

0 comments on commit 20d9155

Please sign in to comment.