From 70934d7cd27cc74ba650c896578285caffbbae4f Mon Sep 17 00:00:00 2001 From: Gregor Giesen Date: Sat, 4 Mar 2023 12:32:41 +0100 Subject: [PATCH] Docs of FromRow -> skip attribute updated as suggested by @abonander Co-authored-by: Austin Bonander --- sqlx-core/src/from_row.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sqlx-core/src/from_row.rs b/sqlx-core/src/from_row.rs index 93a8f5ed..82ebd9c9 100644 --- a/sqlx-core/src/from_row.rs +++ b/sqlx-core/src/from_row.rs @@ -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
` 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