async fn internal_set(
        &self,
        record: DbRecord,
        trans: Option<mysql_async::Transaction<'a>>,
    ) -> Result<()> {
        *(self.num_writes.write().await) += 1;
        self.record_call_stats('w', "internal_set".to_string(), "".to_string())
            .await;

        debug!("BEGIN MySQL set");
        let tic = Instant::now();

        let statement_text = record.set_statement();
        let params = record
            .set_params()
            .ok_or_else(|| Error::Other("Failed to construct MySQL parameters block".into()))?;

        let out = match trans {
            Some(mut tx) => match tx.exec_drop(statement_text, params).await {
                Err(err) => Err(err),
                Ok(next_tx) => Ok(next_tx),
            },
            None => {
                let mut conn = self.get_connection().await?;
                if let Err(err) = conn.exec_drop(statement_text, params).await {
                    Err(err)
                } else {
                    Ok(())
                }
            }
        };
        let result = self.check_for_infra_error(out)?;
        let toc = Instant::now() - tic;
        *(self.time_write.write().await) += toc;

        debug!("END MySQL set");
        Ok(result)
    }
/// Storage a record in the data layer
Storage a record in the data layer
Storage a record in the data layer
async fn internal_set(
        &self,
        record: DbRecord,
        trans: Option<mysql_async::Transaction<'a>>,
    ) -> Result<()> {
        *(self.num_writes.write().await) += 1;
        self.record_call_stats('w', "internal_set".to_string(), "".to_string())
            .await;
        debug!("BEGIN MySQL set");
        let tic = Instant::now();
        let statement_text = record.set_statement();
        let params = record
            .set_params()
            .ok_or_else(|| Error::Other("Failed to construct MySQL parameters block".into()))?;
        let out = match trans {
            Some(mut tx) => match tx.exec_drop(statement_text, params).await {
                Err(err) => Err(err),
                Ok(next_tx) => Ok(next_tx),
            },
            None => {
                let mut conn = self.get_connection().await?;
                if let Err(err) = conn.exec_drop(statement_text, params).await {
                    Err(err)
                } else {
                    Ok(())
                }
            }
        };
        let result = self.check_for_infra_error(out)?;
        let toc = Instant::now() - tic;
        *(self.time_write.write().await) += toc;
        debug!("END MySQL set");
        Ok(result)
    }
async fn internal_set ( & self , record : DbRecord , trans : Option < mysql_async :: Transaction < ' a > > , ) -> Result < ( ) > { * ( self . num_writes . write ( ) . await ) += 1 ; self . record_call_stats ( 'w' , " " . to_string ( ) , " " . to_string ( ) ) . await ; debug ! ( " " ) ; let tic = Instant :: now ( ) ; let statement_text = record . set_statement ( ) ; let params = record . set_params ( ) . ok_or_else ( | | Error :: Other ( " " . into ( ) ) ) ? ; let out = match trans { Some ( mut tx ) => match tx . exec_drop ( statement_text , params ) . await { Err ( err ) => Err ( err ) , Ok ( next_tx ) => Ok ( next_tx ) , } , None => { let mut conn = self . get_connection ( ) . await ? ; if let Err ( err ) = conn . exec_drop ( statement_text , params ) . await { Err ( err ) } else { Ok ( ( ) ) } } } ; let result = self . check_for_infra_error ( out ) ? ; let toc = Instant :: now ( ) - tic ; * ( self . time_write . write ( ) . await ) += toc ; debug ! ( " " ) ; Ok ( result ) }
Storage a record in the data layer
Storage a record in the data layer
&self
record
DbRecord
trans
Option<mysql_async::Transaction<'a>>
&self
record
DbRecord
trans
Option<mysql_async::Transaction<'a>>