mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
Docs of FromRow -> skip attribute updated as suggested by @abonander
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
This commit is contained in:
parent
6713e8cdaa
commit
70934d7cd2
@ -147,20 +147,17 @@ use crate::row::Row;
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// Given 2 querys
|
||||
/// Then when querying into `User`, only `name` needs to be set:
|
||||
///
|
||||
/// ```sql
|
||||
/// SELECT name FROM users;
|
||||
/// ```rust,ignore
|
||||
/// let user: User = sqlx::query_as("SELECT name FROM users")
|
||||
/// .fetch_one(&mut some_connection)
|
||||
/// .await?;
|
||||
///
|
||||
/// `Default` for `Vec<Address>` is an empty vector.
|
||||
/// assert!(user.addresses.is_empty());
|
||||
/// ```
|
||||
///
|
||||
/// and
|
||||
///
|
||||
/// ```sql
|
||||
/// SELECT user_name, street, city addresses;
|
||||
/// ```
|
||||
///
|
||||
/// the addresses can be assigned to the empty `addresses` field of each `User`.
|
||||
///
|
||||
/// ## Manual implementation
|
||||
///
|
||||
/// You can also implement the [`FromRow`] trait by hand. This can be useful if you
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user