You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: articles_repo.rs
    path of file: ./repos/fullstack-rust-axum-dioxus-rwa/backend/src/repos
    
    the code of the file until where you have to start completion: use crate::{
    db::DbConnPool,
    domain::model::{Article, UserProfile},
    AppError,
};
use sqlx::{postgres::PgRow, Pool, Postgres, Row, Transaction};
use std::sync::Arc;

#[derive(Clone)]
pub struct ArticlesRepo {
    dbcp: Arc<DbConnPool>,
}

impl ArticlesRepo {
    //
    pub fn new(dbcp: Arc<DbConnPool>) -> Self {
        Self { dbcp }
    }

    pub async fn get_articles(&self) -> Result<Vec<Article>, AppError> {
        //
        let conn = self.dbcp.as_ref();
        let mut res = sqlx::query(
            "SELECT count(fa.user_id) AS favorites_count,
                    a.id, a.slug, a.title, a.description, a.body, a.created_at, a.updated_at,
                    u.id as user_id, u.username, u.bio, u.image, count(f.user_id) as following 
            FROM articles a
            JOIN accounts u on a.author_id = u.id 
            LEFT OUTER JOIN followings f ON u.id = f.user_id 
            LEFT OUTER JOIN favorited_articles fa ON a.id = fa.article_id
            GROU
    
    pub async fn update(&self, a: &mut Article) -> Result<(), AppError> {
        //
        let mut txn = self.dbcp.begin().await?;
        if let Err(err) = sqlx::query(
            "UPDATE articles SET slug=$1, title=$2, description=$3, body=$4, updated_at=$5 
            WHERE slug=$1 RETURNING id",
        )
        .bind(&a.slug)
        .bind(&a.title)
        .bind(&a.description)
        .bind(&a.body)
        .bind(a.updated_at)
        .map(|r: PgRow| a.id = r.get("id"))
        .fetch_one(&mut *txn)
        .await
        {
            let res_err = ArticlesRepo::render_app_error(err, &a.slug);

            if let Err(e) = txn.rollback().await {
                log::error!("Txn rollback after update on articles failed: {}", e)
            };
            return Err(res_err);
        }

        if self
            .set_tags(&mut txn, a.id, &a.tag_list, false)
            .await
            .is_err()
        {
            if let Err(err) = &mut txn.rollback().await {
                log::error!("Txn rollback failed: {}", err);
                return Err(AppError::InternalErr);
            }
        } else {
            txn.commit().await?;
        }
        Ok(())
    }