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