Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify relationship between query_as! and FromRow #1977

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,13 @@ macro_rules! query_file_unchecked (
///
/// This lets you return the struct from a function or add your own trait implementations.
///
/// **No trait implementations are required**; the macro maps rows using a struct literal
/// where the names of columns in the query are expected to be the same as the fields of the struct
/// (but the order does not need to be the same). The types of the columns are based on the
/// query and not the corresponding fields of the struct, so this is type-safe as well.
/// **This macro does not use [`FromRow`][crate::FromRow]**; in fact, no trait implementations are
/// required at all, though this may change in future versions.
///
/// The macro maps rows using a struct literal where the names of columns in the query are expected
/// to be the same as the fields of the struct (but the order does not need to be the same).
/// The types of the columns are based on the query and not the corresponding fields of the struct,
/// so this is type-safe as well.
///
/// This enforces a few things:
/// * The query must output at least one column.
Expand Down