/// Returns a future that resolves to an insert or `sqlx::Error` of the
/// current instance.
///
/// # Example
///
/// ```rust
/// # sqlx_crud::doctest_setup! { |pool| {
/// use sqlx_crud::{Crud, Schema};
///
/// let user = User { user_id: 1, name: "test".to_string() };
/// let user = user.create(&pool).await?;
/// assert_eq!("test", user.name);
/// # }}
/// ```
Returns a future that resolves to an insert or `sqlx::Error` of the
current instance.
Returns a future that resolves to an insert or ` sqlx :: Error ` of the current instance .
fn create(&'e self, pool: E) -> CrudFut<'e, Self> {
        Box::pin(async move {
            let query = sqlx::query_as::<E::Database, Self>(<Self as Schema>::insert_sql());
            let query = self.insert_binds(query);
            let r = query.fetch_one(pool).await?;
            Ok(r)
        })
    }
fn create ( & ' e self , pool : E ) -> CrudFut < ' e , Self > { Box :: pin ( async move { let query = sqlx :: query_as :: < E :: Database , Self > ( < Self as Schema > :: insert_sql ( ) ) ; let query = self . insert_binds ( query ) ; let r = query . fetch_one ( pool ) . await ? ; Ok ( r ) } ) }
Returns a future that resolves to an insert or `sqlx::Error` of the
current instance.
Returns a future that resolves to an insert or ` sqlx :: Error ` of the current instance .
&'e self
pool
E
example
None
sqlx_crud::doctest_setup! { |pool| {
use sqlx_crud::{Crud, Schema}.

let user = User { user_id: 1, name: "test".to_string() };
let user = user.create(&pool).await?;
assert_eq!("test", user.name).
use sqlx_crud :: { Crud Schema } . let user = User { user_id : 1 name : " test " . to_string () } ; let user = user . create ( &pool ) . await? ; assert_eq! ( " test " user . name ) .
}}
None