use diesel_async::RunQueryDsl;
impl CommentAggregates {
- pub async fn read(pool: &DbPool, comment_id: CommentId) -> Result<Self, Error> {
+ pub async fn read(pool: &mut DbPool<'_>, comment_id: CommentId) -> Result<Self, Error> {
let conn = &mut get_conn(pool).await?;
comment_aggregates::table
.filter(comment_aggregates::comment_id.eq(comment_id))
.await
}
- pub async fn update_hot_rank(pool: &DbPool, comment_id: CommentId) -> Result<Self, Error> {
+ pub async fn update_hot_rank(
+ pool: &mut DbPool<'_>,
+ comment_id: CommentId,
+ ) -> Result<Self, Error> {
let conn = &mut get_conn(pool).await?;
diesel::update(comment_aggregates::table)
#[serial]
async fn test_crud() {
let pool = &build_db_pool_for_tests().await;
+ let pool = &mut pool.into();
let inserted_instance = Instance::read_or_create(pool, "my_domain.tld".to_string())
.await