Add SQLx operation tracing (#5223)
* wip: vendor sqlx-tracing * (compiles) standardize pg types used * more standardization * general log message improvements * wip: improve sqlx-tracing architecture * unify sqlx::Executor type * wip: try fix sqlx tracing * wip: sqlx-tracing compiles * so close * it compiles * fix ci
This commit is contained in:
@@ -11,13 +11,13 @@ mod old;
|
||||
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use crate::database::PgPool;
|
||||
use actix_web::{HttpRequest, post, web};
|
||||
use chrono::{DateTime, TimeDelta, Utc};
|
||||
use eyre::eyre;
|
||||
use futures::StreamExt;
|
||||
use rust_decimal::Decimal;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
|
||||
use crate::{
|
||||
auth::{AuthenticationError, get_user_from_headers},
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use super::ApiError;
|
||||
use crate::database;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::redis::RedisPool;
|
||||
use crate::models::teams::ProjectPermissions;
|
||||
use crate::{
|
||||
@@ -15,7 +16,6 @@ use ariadne::ids::base62_impl::to_base62;
|
||||
use chrono::{DateTime, Duration, Utc};
|
||||
use eyre::eyre;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
use sqlx::postgres::types::PgInterval;
|
||||
use std::collections::HashMap;
|
||||
use std::convert::TryInto;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::auth::checks::is_visible_collection;
|
||||
use crate::auth::{filter_visible_collections, get_user_from_headers};
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::{
|
||||
collection_item, generate_collection_id, project_item,
|
||||
};
|
||||
@@ -24,7 +25,6 @@ use chrono::Utc;
|
||||
use eyre::eyre;
|
||||
use itertools::Itertools;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
use std::sync::Arc;
|
||||
use validator::Validate;
|
||||
|
||||
@@ -96,7 +96,7 @@ pub async fn collection_create(
|
||||
|
||||
let initial_project_ids = project_item::DBProject::get_many(
|
||||
&collection_create_data.projects,
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
&redis,
|
||||
)
|
||||
.await?
|
||||
@@ -274,7 +274,7 @@ pub async fn collection_edit(
|
||||
name.trim(),
|
||||
id as database::models::ids::DBCollectionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ pub async fn collection_edit(
|
||||
description.as_ref(),
|
||||
id as database::models::ids::DBCollectionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ pub async fn collection_edit(
|
||||
status.to_string(),
|
||||
id as database::models::ids::DBCollectionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ pub async fn collection_edit(
|
||||
",
|
||||
collection_item.id as database::models::ids::DBCollectionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
let collection_item_ids = new_project_ids
|
||||
@@ -352,7 +352,7 @@ pub async fn collection_edit(
|
||||
&collection_item_ids[..],
|
||||
&validated_project_ids[..],
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
sqlx::query!(
|
||||
@@ -363,7 +363,7 @@ pub async fn collection_edit(
|
||||
",
|
||||
collection_item.id as database::models::ids::DBCollectionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ pub async fn collection_icon_edit(
|
||||
upload_result.color.map(|x| x as i32),
|
||||
collection_item.id as database::models::ids::DBCollectionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -517,7 +517,7 @@ pub async fn delete_collection_icon(
|
||||
",
|
||||
collection_item.id as database::models::ids::DBCollectionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use crate::auth::get_user_from_headers;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::friend_item::DBFriend;
|
||||
use crate::database::models::{DBUser, DBUserId};
|
||||
use crate::database::redis::RedisPool;
|
||||
@@ -15,7 +16,6 @@ use crate::sync::status::get_user_status;
|
||||
use actix_web::{HttpRequest, HttpResponse, delete, get, post, web};
|
||||
use ariadne::networking::message::ServerToClientMessage;
|
||||
use chrono::Utc;
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(add_friend);
|
||||
|
||||
@@ -4,6 +4,7 @@ use super::threads::is_authorized_thread;
|
||||
use crate::auth::checks::{is_team_member_project, is_team_member_version};
|
||||
use crate::auth::get_user_from_headers;
|
||||
use crate::database;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::{
|
||||
project_item, report_item, thread_item, version_item,
|
||||
};
|
||||
@@ -17,7 +18,6 @@ use crate::util::img::upload_image_optimized;
|
||||
use crate::util::routes::read_limited_from_payload;
|
||||
use actix_web::{HttpRequest, HttpResponse, web};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.route("image", web::post().to(images_add));
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use crate::database::PgPool;
|
||||
use crate::{
|
||||
auth::get_user_from_headers,
|
||||
database::redis::RedisPool,
|
||||
@@ -6,7 +7,6 @@ use crate::{
|
||||
routes::ApiError,
|
||||
};
|
||||
use actix_web::{HttpRequest, web};
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::auth::get_user_from_headers;
|
||||
use crate::database;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::redis::RedisPool;
|
||||
use crate::models::ids::NotificationId;
|
||||
use crate::models::notifications::Notification;
|
||||
@@ -8,7 +9,6 @@ use crate::queue::session::AuthQueue;
|
||||
use crate::routes::ApiError;
|
||||
use actix_web::{HttpRequest, HttpResponse, web};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.route("notifications", web::get().to(notifications_get));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::{collections::HashSet, fmt::Display, sync::Arc};
|
||||
|
||||
use super::ApiError;
|
||||
use crate::database::{PgPool, PgTransaction};
|
||||
use crate::file_hosting::FileHostPublicity;
|
||||
use crate::models::ids::OAuthClientId;
|
||||
use crate::util::img::{delete_old_images, upload_image_optimized};
|
||||
@@ -38,7 +39,6 @@ use itertools::Itertools;
|
||||
use rand::{Rng, SeedableRng, distributions::Alphanumeric};
|
||||
use rand_chacha::ChaCha20Rng;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
use validator::Validate;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
@@ -325,7 +325,7 @@ pub async fn oauth_client_edit(
|
||||
|
||||
let mut transaction = pool.begin().await?;
|
||||
updated_client
|
||||
.update_editable_fields(&mut *transaction)
|
||||
.update_editable_fields(&mut transaction)
|
||||
.await?;
|
||||
|
||||
if let Some(redirects) = redirect_uris {
|
||||
@@ -410,7 +410,7 @@ pub async fn oauth_client_icon_edit(
|
||||
editable_client.raw_icon_url = Some(upload_result.raw_url);
|
||||
|
||||
editable_client
|
||||
.update_editable_fields(&mut *transaction)
|
||||
.update_editable_fields(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -461,7 +461,7 @@ pub async fn oauth_client_icon_delete(
|
||||
editable_client.raw_icon_url = None;
|
||||
|
||||
editable_client
|
||||
.update_editable_fields(&mut *transaction)
|
||||
.update_editable_fields(&mut transaction)
|
||||
.await?;
|
||||
transaction.commit().await?;
|
||||
|
||||
@@ -536,7 +536,7 @@ fn generate_oauth_client_secret() -> String {
|
||||
async fn create_redirect_uris(
|
||||
uri_strings: impl IntoIterator<Item = impl Display>,
|
||||
client_id: DBOAuthClientId,
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
) -> Result<Vec<DBOAuthRedirectUri>, DatabaseError> {
|
||||
let mut redirect_uris = vec![];
|
||||
for uri in uri_strings.into_iter() {
|
||||
@@ -554,7 +554,7 @@ async fn create_redirect_uris(
|
||||
async fn edit_redirects(
|
||||
redirects: Vec<String>,
|
||||
existing_client: &DBOAuthClient,
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
) -> Result<(), DatabaseError> {
|
||||
let updated_redirects: HashSet<String> = redirects.into_iter().collect();
|
||||
let original_redirects: HashSet<String> = existing_client
|
||||
@@ -569,14 +569,14 @@ async fn edit_redirects(
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?;
|
||||
DBOAuthClient::insert_redirect_uris(&redirects_to_add, &mut **transaction)
|
||||
DBOAuthClient::insert_redirect_uris(&redirects_to_add, &mut *transaction)
|
||||
.await?;
|
||||
|
||||
let mut redirects_to_remove = existing_client.redirect_uris.clone();
|
||||
redirects_to_remove.retain(|r| !updated_redirects.contains(&r.uri));
|
||||
DBOAuthClient::remove_redirect_uris(
|
||||
redirects_to_remove.iter().map(|r| r.id),
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ use std::sync::Arc;
|
||||
use super::ApiError;
|
||||
use crate::auth::checks::is_visible_organization;
|
||||
use crate::auth::{filter_visible_projects, get_user_from_headers};
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::team_item::DBTeamMember;
|
||||
use crate::database::models::{
|
||||
DBOrganization, generate_organization_id, team_item,
|
||||
@@ -25,7 +26,6 @@ use ariadne::ids::UserId;
|
||||
use futures::TryStreamExt;
|
||||
use rust_decimal::Decimal;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
use validator::Validate;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
@@ -158,7 +158,7 @@ pub async fn organization_create(
|
||||
organization_strings.push(new_organization.slug.clone());
|
||||
let results = DBOrganization::get_many(
|
||||
&organization_strings,
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
&redis,
|
||||
)
|
||||
.await?;
|
||||
@@ -454,7 +454,7 @@ pub async fn organizations_edit(
|
||||
description,
|
||||
id as database::models::ids::DBOrganizationId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ pub async fn organizations_edit(
|
||||
name,
|
||||
id as database::models::ids::DBOrganizationId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -488,7 +488,7 @@ pub async fn organizations_edit(
|
||||
|
||||
let existing = DBOrganization::get(
|
||||
&slug.to_lowercase(),
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
&redis,
|
||||
)
|
||||
.await?;
|
||||
@@ -513,7 +513,7 @@ pub async fn organizations_edit(
|
||||
",
|
||||
slug
|
||||
)
|
||||
.fetch_one(&mut *transaction)
|
||||
.fetch_one(&mut transaction)
|
||||
.await?;
|
||||
|
||||
if results.exists.unwrap_or(true) {
|
||||
@@ -533,7 +533,7 @@ pub async fn organizations_edit(
|
||||
Some(slug),
|
||||
id as database::models::ids::DBOrganizationId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -640,7 +640,7 @@ pub async fn organization_delete(
|
||||
",
|
||||
organization.id as database::models::ids::DBOrganizationId
|
||||
)
|
||||
.fetch(&mut *transaction)
|
||||
.fetch(&mut transaction)
|
||||
.map_ok(|c| database::models::DBTeamId(c.id))
|
||||
.try_collect::<Vec<_>>()
|
||||
.await?;
|
||||
@@ -797,7 +797,7 @@ pub async fn organization_projects_add(
|
||||
organization.id as database::models::DBOrganizationId,
|
||||
project_item.inner.id as database::models::ids::DBProjectId
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
// The former owner is no longer an owner (as it is now 'owned' by the organization, 'given' to them)
|
||||
@@ -813,7 +813,7 @@ pub async fn organization_projects_add(
|
||||
",
|
||||
organization.team_id as database::models::ids::DBTeamId
|
||||
)
|
||||
.fetch_one(&mut *transaction)
|
||||
.fetch_one(&mut transaction)
|
||||
.await?;
|
||||
let organization_owner_user_id =
|
||||
database::models::ids::DBUserId(organization_owner_user_id.id);
|
||||
@@ -826,7 +826,7 @@ pub async fn organization_projects_add(
|
||||
project_item.inner.team_id as database::models::ids::DBTeamId,
|
||||
organization_owner_user_id as database::models::ids::DBUserId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -1004,7 +1004,7 @@ pub async fn organization_projects_remove(
|
||||
new_owner.id as database::models::ids::DBTeamMemberId,
|
||||
ProjectPermissions::all().bits() as i64
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
sqlx::query!(
|
||||
@@ -1015,7 +1015,7 @@ pub async fn organization_projects_remove(
|
||||
",
|
||||
project_item.inner.id as database::models::ids::DBProjectId
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -1144,7 +1144,7 @@ pub async fn organization_icon_edit(
|
||||
upload_result.color.map(|x| x as i32),
|
||||
organization_item.id as database::models::ids::DBOrganizationId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -1227,7 +1227,7 @@ pub async fn delete_organization_icon(
|
||||
",
|
||||
organization_item.id as database::models::ids::DBOrganizationId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::auth::validate::get_user_record_from_bearer_token;
|
||||
use crate::auth::{AuthenticationError, get_user_from_headers};
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::DBUserId;
|
||||
use crate::database::models::{generate_payout_id, users_compliance};
|
||||
use crate::database::redis::RedisPool;
|
||||
@@ -21,7 +22,6 @@ use reqwest::Method;
|
||||
use rust_decimal::Decimal;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::Sha256;
|
||||
use sqlx::PgPool;
|
||||
use std::collections::HashMap;
|
||||
use tokio_stream::StreamExt;
|
||||
use tracing::error;
|
||||
@@ -71,7 +71,7 @@ pub async fn post_compliance_form(
|
||||
let mut txn = pool.begin().await?;
|
||||
|
||||
let maybe_compliance =
|
||||
users_compliance::UserCompliance::get_by_user_id(&mut *txn, user_id)
|
||||
users_compliance::UserCompliance::get_by_user_id(&mut txn, user_id)
|
||||
.await?;
|
||||
|
||||
let mut compliance = match maybe_compliance {
|
||||
@@ -125,7 +125,7 @@ pub async fn post_compliance_form(
|
||||
compliance.form_type = Some(body.0.form_type);
|
||||
compliance.last_checked = Utc::now() - COMPLIANCE_CHECK_DEBOUNCE;
|
||||
|
||||
compliance.upsert_partial(&mut *txn).await?;
|
||||
compliance.upsert_partial(&mut txn).await?;
|
||||
txn.commit().await?;
|
||||
|
||||
Ok(HttpResponse::Ok().json(toplevel))
|
||||
@@ -250,7 +250,7 @@ pub async fn paypal_webhook(
|
||||
webhook.resource.payout_item_id,
|
||||
PayoutStatus::InTransit.as_str()
|
||||
)
|
||||
.fetch_optional(&mut *transaction)
|
||||
.fetch_optional(&mut transaction)
|
||||
.await?;
|
||||
|
||||
if let Some(result) = result {
|
||||
@@ -268,7 +268,7 @@ pub async fn paypal_webhook(
|
||||
.as_str(),
|
||||
webhook.resource.payout_item_id
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -294,7 +294,7 @@ pub async fn paypal_webhook(
|
||||
PayoutStatus::Success.as_str(),
|
||||
webhook.resource.payout_item_id
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
transaction.commit().await?;
|
||||
}
|
||||
@@ -361,7 +361,7 @@ pub async fn tremendous_webhook(
|
||||
webhook.payload.resource.id,
|
||||
PayoutStatus::InTransit.as_str()
|
||||
)
|
||||
.fetch_optional(&mut *transaction)
|
||||
.fetch_optional(&mut transaction)
|
||||
.await?;
|
||||
|
||||
if let Some(result) = result {
|
||||
@@ -379,7 +379,7 @@ pub async fn tremendous_webhook(
|
||||
.as_str(),
|
||||
webhook.payload.resource.id
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -405,7 +405,7 @@ pub async fn tremendous_webhook(
|
||||
PayoutStatus::Success.as_str(),
|
||||
webhook.payload.resource.id
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
transaction.commit().await?;
|
||||
}
|
||||
@@ -491,7 +491,7 @@ pub async fn create_payout(
|
||||
",
|
||||
user.id.0
|
||||
)
|
||||
.fetch_optional(&mut *transaction)
|
||||
.fetch_optional(&mut transaction)
|
||||
.await
|
||||
.wrap_internal_err("failed to fetch user balance")?;
|
||||
|
||||
@@ -827,7 +827,7 @@ pub async fn cancel_payout(
|
||||
PayoutStatus::Cancelling.as_str(),
|
||||
platform_id
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
transaction.commit().await?;
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
use super::version_creation::{InitialVersionData, try_create_version_fields};
|
||||
use crate::auth::{AuthenticationError, get_user_from_headers};
|
||||
use crate::database::PgPool;
|
||||
use crate::database::PgTransaction;
|
||||
use crate::database::models::loader_fields::{
|
||||
Loader, LoaderField, LoaderFieldEnumValue,
|
||||
};
|
||||
@@ -36,7 +38,6 @@ use image::ImageError;
|
||||
use itertools::Itertools;
|
||||
use rust_decimal::Decimal;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::postgres::PgPool;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use thiserror::Error;
|
||||
@@ -405,7 +406,7 @@ Project Creation Steps:
|
||||
async fn project_create_inner(
|
||||
req: HttpRequest,
|
||||
payload: &mut Multipart,
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
file_host: &dyn FileHost,
|
||||
uploaded_files: &mut Vec<UploadedFile>,
|
||||
pool: &PgPool,
|
||||
@@ -429,7 +430,7 @@ async fn project_create_inner(
|
||||
}
|
||||
|
||||
let all_loaders =
|
||||
models::loader_fields::Loader::list(&mut **transaction, redis).await?;
|
||||
models::loader_fields::Loader::list(&mut *transaction, redis).await?;
|
||||
|
||||
let project_create_data: ProjectCreateData;
|
||||
let mut versions;
|
||||
@@ -484,7 +485,7 @@ async fn project_create_inner(
|
||||
",
|
||||
slug_project_id as models::ids::DBProjectId
|
||||
)
|
||||
.fetch_one(&mut **transaction)
|
||||
.fetch_one(&mut *transaction)
|
||||
.await
|
||||
.map_err(|e| CreateError::DatabaseError(e.into()))?;
|
||||
|
||||
@@ -500,7 +501,7 @@ async fn project_create_inner(
|
||||
",
|
||||
create_data.slug
|
||||
)
|
||||
.fetch_one(&mut **transaction)
|
||||
.fetch_one(&mut *transaction)
|
||||
.await
|
||||
.map_err(|e| CreateError::DatabaseError(e.into()))?;
|
||||
|
||||
@@ -695,7 +696,7 @@ async fn project_create_inner(
|
||||
for category in &project_create_data.categories {
|
||||
let ids = models::categories::Category::get_ids(
|
||||
category,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?;
|
||||
if ids.is_empty() {
|
||||
@@ -712,7 +713,7 @@ async fn project_create_inner(
|
||||
for category in &project_create_data.additional_categories {
|
||||
let ids = models::categories::Category::get_ids(
|
||||
category,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?;
|
||||
if ids.is_empty() {
|
||||
@@ -798,12 +799,12 @@ async fn project_create_inner(
|
||||
let mut link_urls = vec![];
|
||||
|
||||
let link_platforms =
|
||||
models::categories::LinkPlatform::list(&mut **transaction, redis)
|
||||
models::categories::LinkPlatform::list(&mut *transaction, redis)
|
||||
.await?;
|
||||
for (platform, url) in &project_create_data.link_urls {
|
||||
let platform_id = models::categories::LinkPlatform::get_id(
|
||||
platform,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?
|
||||
.ok_or_else(|| {
|
||||
@@ -875,7 +876,7 @@ async fn project_create_inner(
|
||||
for image_id in project_create_data.uploaded_images {
|
||||
if let Some(db_image) = image_item::DBImage::get(
|
||||
image_id.into(),
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
redis,
|
||||
)
|
||||
.await?
|
||||
@@ -898,7 +899,7 @@ async fn project_create_inner(
|
||||
id as models::ids::DBProjectId,
|
||||
image_id.0 as i64
|
||||
)
|
||||
.execute(&mut **transaction)
|
||||
.execute(&mut *transaction)
|
||||
.await?;
|
||||
|
||||
image_item::DBImage::clear_cache(image.id.into(), redis)
|
||||
@@ -925,7 +926,7 @@ async fn project_create_inner(
|
||||
.flat_map(|v| v.loaders.clone())
|
||||
.unique()
|
||||
.collect::<Vec<_>>();
|
||||
let (project_types, games) = Loader::list(&mut **transaction, redis)
|
||||
let (project_types, games) = Loader::list(&mut *transaction, redis)
|
||||
.await?
|
||||
.into_iter()
|
||||
.fold(
|
||||
@@ -997,7 +998,7 @@ async fn create_initial_version(
|
||||
project_id: ProjectId,
|
||||
author: UserId,
|
||||
all_loaders: &[models::loader_fields::Loader],
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
redis: &RedisPool,
|
||||
) -> Result<models::version_item::VersionBuilder, CreateError> {
|
||||
if version_data.project_id.is_some() {
|
||||
@@ -1027,11 +1028,11 @@ async fn create_initial_version(
|
||||
.collect::<Result<Vec<models::LoaderId>, CreateError>>()?;
|
||||
|
||||
let loader_fields =
|
||||
LoaderField::get_fields(&loaders, &mut **transaction, redis).await?;
|
||||
LoaderField::get_fields(&loaders, &mut *transaction, redis).await?;
|
||||
let mut loader_field_enum_values =
|
||||
LoaderFieldEnumValue::list_many_loader_fields(
|
||||
&loader_fields,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
redis,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -11,6 +11,7 @@ use crate::database::models::{
|
||||
};
|
||||
use crate::database::redis::RedisPool;
|
||||
use crate::database::{self, models as db_models};
|
||||
use crate::database::{PgPool, PgTransaction};
|
||||
use crate::file_hosting::{FileHost, FileHostPublicity};
|
||||
use crate::models;
|
||||
use crate::models::ids::{ProjectId, VersionId};
|
||||
@@ -40,7 +41,6 @@ use futures::TryStreamExt;
|
||||
use itertools::Itertools;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
use sqlx::PgPool;
|
||||
use validator::Validate;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
@@ -328,7 +328,7 @@ pub async fn project_edit(
|
||||
name.trim(),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ pub async fn project_edit(
|
||||
summary,
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -404,7 +404,7 @@ pub async fn project_edit(
|
||||
",
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
moderation_queue
|
||||
@@ -421,7 +421,7 @@ pub async fn project_edit(
|
||||
",
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -447,7 +447,7 @@ pub async fn project_edit(
|
||||
",
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ pub async fn project_edit(
|
||||
",
|
||||
project_item.inner.team_id as db_ids::DBTeamId
|
||||
)
|
||||
.fetch(&mut *transaction)
|
||||
.fetch(&mut transaction)
|
||||
.map_ok(|c| db_models::DBUserId(c.id))
|
||||
.try_collect::<Vec<_>>()
|
||||
.await?;
|
||||
@@ -537,7 +537,7 @@ pub async fn project_edit(
|
||||
status.as_str(),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ pub async fn project_edit(
|
||||
requested_status.map(|x| x.as_str()),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ pub async fn project_edit(
|
||||
",
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@ pub async fn project_edit(
|
||||
",
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
@@ -636,7 +636,7 @@ pub async fn project_edit(
|
||||
license_url.as_deref(),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ pub async fn project_edit(
|
||||
|
||||
let existing = db_models::DBProject::get(
|
||||
&slug.to_lowercase(),
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
&redis,
|
||||
)
|
||||
.await?;
|
||||
@@ -674,7 +674,7 @@ pub async fn project_edit(
|
||||
",
|
||||
slug
|
||||
)
|
||||
.fetch_one(&mut *transaction)
|
||||
.fetch_one(&mut transaction)
|
||||
.await?;
|
||||
|
||||
if results.exists.unwrap_or(true) {
|
||||
@@ -693,7 +693,7 @@ pub async fn project_edit(
|
||||
Some(slug),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -726,7 +726,7 @@ pub async fn project_edit(
|
||||
license,
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -752,14 +752,14 @@ pub async fn project_edit(
|
||||
id as db_ids::DBProjectId,
|
||||
&ids_to_delete
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
for (platform, url) in links {
|
||||
if let Some(url) = url {
|
||||
let platform_id = db_models::categories::LinkPlatform::get_id(
|
||||
platform,
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
)
|
||||
.await?
|
||||
.ok_or_else(|| {
|
||||
@@ -777,7 +777,7 @@ pub async fn project_edit(
|
||||
platform_id as db_ids::LinkPlatformId,
|
||||
url
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
@@ -802,7 +802,7 @@ pub async fn project_edit(
|
||||
moderation_message.as_deref(),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -827,7 +827,7 @@ pub async fn project_edit(
|
||||
moderation_message_body.as_deref(),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -848,7 +848,7 @@ pub async fn project_edit(
|
||||
description,
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -880,7 +880,7 @@ pub async fn project_edit(
|
||||
monetization_status.as_str(),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -903,7 +903,7 @@ pub async fn project_edit(
|
||||
side_types_migration_review_status.as_str(),
|
||||
id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ pub async fn edit_project_categories(
|
||||
perms: &ProjectPermissions,
|
||||
project_id: db_ids::DBProjectId,
|
||||
is_additional: bool,
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
) -> Result<(), ApiError> {
|
||||
if !perms.contains(ProjectPermissions::EDIT_DETAILS) {
|
||||
let additional_str = if is_additional { "additional " } else { "" };
|
||||
@@ -1006,7 +1006,7 @@ pub async fn edit_project_categories(
|
||||
for category in categories {
|
||||
let category_ids = db_models::categories::Category::get_ids(
|
||||
category,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?;
|
||||
// TODO: We should filter out categories that don't match the project type of any of the versions
|
||||
@@ -1373,7 +1373,7 @@ pub async fn projects_edit(
|
||||
project.inner.id as db_ids::DBProjectId,
|
||||
&ids_to_delete
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
for (platform, url) in links {
|
||||
@@ -1397,7 +1397,7 @@ pub async fn projects_edit(
|
||||
platform_id as db_ids::LinkPlatformId,
|
||||
url
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
@@ -1424,7 +1424,7 @@ pub async fn bulk_edit_project_categories(
|
||||
bulk_changes: CategoryChanges<'_>,
|
||||
max_num_categories: usize,
|
||||
is_additional: bool,
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
) -> Result<(), ApiError> {
|
||||
let mut set_categories =
|
||||
if let Some(categories) = bulk_changes.categories.clone() {
|
||||
@@ -1461,7 +1461,7 @@ pub async fn bulk_edit_project_categories(
|
||||
project_id as db_ids::DBProjectId,
|
||||
is_additional
|
||||
)
|
||||
.execute(&mut **transaction)
|
||||
.execute(&mut *transaction)
|
||||
.await?;
|
||||
|
||||
let mut mod_categories = Vec::new();
|
||||
@@ -1594,7 +1594,7 @@ pub async fn project_icon_edit(
|
||||
upload_result.color.map(|x| x as i32),
|
||||
project_item.inner.id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -1684,7 +1684,7 @@ pub async fn delete_project_icon(
|
||||
",
|
||||
project_item.inner.id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -1823,7 +1823,7 @@ pub async fn add_gallery_item(
|
||||
project_item.inner.id as db_ids::DBProjectId,
|
||||
false,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -1969,7 +1969,7 @@ pub async fn edit_gallery_item(
|
||||
project_item.inner.id as db_ids::DBProjectId,
|
||||
false,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -1982,7 +1982,7 @@ pub async fn edit_gallery_item(
|
||||
result.id,
|
||||
featured
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
if let Some(name) = item.name {
|
||||
@@ -1995,7 +1995,7 @@ pub async fn edit_gallery_item(
|
||||
result.id,
|
||||
name
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
if let Some(description) = item.description {
|
||||
@@ -2008,7 +2008,7 @@ pub async fn edit_gallery_item(
|
||||
result.id,
|
||||
description
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
if let Some(ordering) = item.ordering {
|
||||
@@ -2021,7 +2021,7 @@ pub async fn edit_gallery_item(
|
||||
result.id,
|
||||
ordering
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -2137,7 +2137,7 @@ pub async fn delete_gallery_item(
|
||||
",
|
||||
item.id
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -2228,7 +2228,7 @@ pub async fn project_delete(
|
||||
",
|
||||
project.inner.id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
let result = db_models::DBProject::remove(
|
||||
@@ -2313,7 +2313,7 @@ pub async fn project_follow(
|
||||
",
|
||||
project_id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
sqlx::query!(
|
||||
@@ -2324,7 +2324,7 @@ pub async fn project_follow(
|
||||
user_id as db_ids::DBUserId,
|
||||
project_id as db_ids::DBProjectId
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
@@ -2389,7 +2389,7 @@ pub async fn project_unfollow(
|
||||
",
|
||||
project_id as db_ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
sqlx::query!(
|
||||
@@ -2400,7 +2400,7 @@ pub async fn project_unfollow(
|
||||
user_id as db_ids::DBUserId,
|
||||
project_id as db_ids::DBProjectId
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::auth::{check_is_moderator_from_headers, get_user_from_headers};
|
||||
use crate::database;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::image_item;
|
||||
use crate::database::models::notification_item::NotificationBuilder;
|
||||
use crate::database::models::thread_item::{
|
||||
@@ -22,7 +23,6 @@ use ariadne::ids::UserId;
|
||||
use ariadne::ids::base62_impl::parse_base62;
|
||||
use chrono::Utc;
|
||||
use serde::Deserialize;
|
||||
use sqlx::PgPool;
|
||||
use validator::Validate;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
@@ -71,7 +71,7 @@ pub async fn report_create(
|
||||
crate::database::models::generate_report_id(&mut transaction).await?;
|
||||
let report_type = crate::database::models::categories::ReportType::get_id(
|
||||
&new_report.report_type,
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
)
|
||||
.await?
|
||||
.ok_or_else(|| {
|
||||
@@ -102,7 +102,7 @@ pub async fn report_create(
|
||||
"SELECT EXISTS(SELECT 1 FROM mods WHERE id = $1)",
|
||||
project_id.0 as i64
|
||||
)
|
||||
.fetch_one(&mut *transaction)
|
||||
.fetch_one(&mut transaction)
|
||||
.await?;
|
||||
|
||||
if !result.exists.unwrap_or(false) {
|
||||
@@ -122,7 +122,7 @@ pub async fn report_create(
|
||||
"SELECT EXISTS(SELECT 1 FROM versions WHERE id = $1)",
|
||||
version_id.0 as i64
|
||||
)
|
||||
.fetch_one(&mut *transaction)
|
||||
.fetch_one(&mut transaction)
|
||||
.await?;
|
||||
|
||||
if !result.exists.unwrap_or(false) {
|
||||
@@ -141,7 +141,7 @@ pub async fn report_create(
|
||||
"SELECT EXISTS(SELECT 1 FROM users WHERE id = $1)",
|
||||
user_id.0 as i64
|
||||
)
|
||||
.fetch_one(&mut *transaction)
|
||||
.fetch_one(&mut transaction)
|
||||
.await?;
|
||||
|
||||
if !result.exists.unwrap_or(false) {
|
||||
@@ -165,7 +165,7 @@ pub async fn report_create(
|
||||
|
||||
for image_id in new_report.uploaded_images {
|
||||
if let Some(db_image) =
|
||||
image_item::DBImage::get(image_id.into(), &mut *transaction, &redis)
|
||||
image_item::DBImage::get(image_id.into(), &mut transaction, &redis)
|
||||
.await?
|
||||
{
|
||||
let image: Image = db_image.into();
|
||||
@@ -186,7 +186,7 @@ pub async fn report_create(
|
||||
id.0 as i64,
|
||||
image_id.0 as i64
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
image_item::DBImage::clear_cache(image.id.into(), &redis).await?;
|
||||
@@ -442,7 +442,7 @@ pub async fn report_edit(
|
||||
edit_body,
|
||||
id as crate::database::models::ids::DBReportId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ pub async fn report_edit(
|
||||
edit_closed,
|
||||
id as crate::database::models::ids::DBReportId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use crate::database::models::{
|
||||
generate_shared_instance_version_id,
|
||||
};
|
||||
use crate::database::redis::RedisPool;
|
||||
use crate::database::{PgPool, PgTransaction};
|
||||
use crate::file_hosting::{FileHost, FileHostPublicity};
|
||||
use crate::models::ids::{SharedInstanceId, SharedInstanceVersionId};
|
||||
use crate::models::pats::Scopes;
|
||||
@@ -24,7 +25,6 @@ use bytes::BytesMut;
|
||||
use chrono::Utc;
|
||||
use futures_util::StreamExt;
|
||||
use hex::FromHex;
|
||||
use sqlx::{PgPool, Postgres, Transaction};
|
||||
use std::sync::Arc;
|
||||
|
||||
const MAX_FILE_SIZE: usize = 500 * 1024 * 1024;
|
||||
@@ -100,7 +100,7 @@ async fn shared_instance_version_create_inner(
|
||||
file_host: &dyn FileHost,
|
||||
instance_id: DBSharedInstanceId,
|
||||
session_queue: &AuthQueue,
|
||||
transaction: &mut Transaction<'_, Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
uploaded_files: &mut Vec<UploadedFile>,
|
||||
) -> Result<HttpResponse, ApiError> {
|
||||
let user = get_user_from_headers(
|
||||
@@ -192,7 +192,7 @@ async fn shared_instance_version_create_inner(
|
||||
new_version.id as DBSharedInstanceVersionId,
|
||||
instance_id as DBSharedInstanceId,
|
||||
)
|
||||
.execute(&mut **transaction)
|
||||
.execute(&mut *transaction)
|
||||
.await?;
|
||||
|
||||
let version: SharedInstanceVersion = new_version.into();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::auth::get_user_from_headers;
|
||||
use crate::auth::validate::get_maybe_user_from_headers;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::shared_instance_item::{
|
||||
DBSharedInstance, DBSharedInstanceUser, DBSharedInstanceVersion,
|
||||
};
|
||||
@@ -21,7 +22,6 @@ use actix_web::web::{Data, Redirect};
|
||||
use actix_web::{HttpRequest, HttpResponse, web};
|
||||
use futures_util::future::try_join_all;
|
||||
use serde::Deserialize;
|
||||
use sqlx::PgPool;
|
||||
use std::sync::Arc;
|
||||
use validator::Validate;
|
||||
|
||||
@@ -277,7 +277,7 @@ pub async fn shared_instance_edit(
|
||||
title,
|
||||
id as DBSharedInstanceId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ pub async fn shared_instance_edit(
|
||||
public,
|
||||
id as DBSharedInstanceId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ async fn delete_instance_version(
|
||||
",
|
||||
version_id as DBSharedInstanceVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
sqlx::query!(
|
||||
@@ -554,7 +554,7 @@ async fn delete_instance_version(
|
||||
",
|
||||
instance_id as DBSharedInstanceId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::database::PgPool;
|
||||
use crate::routes::ApiError;
|
||||
use actix_web::{HttpResponse, web};
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.route("statistics", web::get().to(get_stats));
|
||||
|
||||
@@ -10,9 +10,9 @@ use crate::database::models::loader_fields::{
|
||||
use crate::database::redis::RedisPool;
|
||||
use actix_web::{HttpResponse, web};
|
||||
|
||||
use crate::database::PgPool;
|
||||
use itertools::Itertools;
|
||||
use serde_json::Value;
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::auth::checks::{is_visible_organization, is_visible_project};
|
||||
use crate::auth::get_user_from_headers;
|
||||
use crate::database::DBProject;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::notification_item::NotificationBuilder;
|
||||
use crate::database::models::team_item::TeamAssociationId;
|
||||
use crate::database::models::{DBOrganization, DBTeam, DBTeamMember, DBUser};
|
||||
@@ -15,7 +16,6 @@ use actix_web::{HttpRequest, HttpResponse, web};
|
||||
use ariadne::ids::UserId;
|
||||
use rust_decimal::Decimal;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.route("teams", web::get().to(teams_get));
|
||||
@@ -997,7 +997,7 @@ pub async fn transfer_ownership(
|
||||
",
|
||||
oid.0 as i64
|
||||
)
|
||||
.fetch_all(&mut *transaction)
|
||||
.fetch_all(&mut transaction)
|
||||
.await?;
|
||||
|
||||
let team_ids: Vec<crate::database::models::ids::DBTeamId> =
|
||||
|
||||
@@ -2,6 +2,7 @@ use std::sync::Arc;
|
||||
|
||||
use crate::auth::get_user_from_headers;
|
||||
use crate::database;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::image_item;
|
||||
use crate::database::models::notification_item::NotificationBuilder;
|
||||
use crate::database::models::thread_item::ThreadMessageBuilder;
|
||||
@@ -19,7 +20,6 @@ use crate::routes::ApiError;
|
||||
use actix_web::{HttpRequest, HttpResponse, web};
|
||||
use futures::TryStreamExt;
|
||||
use serde::Deserialize;
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(
|
||||
@@ -546,7 +546,7 @@ pub async fn thread_send_message_internal(
|
||||
for image_id in associated_images {
|
||||
if let Some(db_image) = image_item::DBImage::get(
|
||||
(*image_id).into(),
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
redis,
|
||||
)
|
||||
.await?
|
||||
@@ -571,7 +571,7 @@ pub async fn thread_send_message_internal(
|
||||
thread.id.0,
|
||||
image_id.0 as i64
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
image_item::DBImage::clear_cache(image.id.into(), redis)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use super::{ApiError, oauth_clients::get_user_clients};
|
||||
use crate::database::PgPool;
|
||||
use crate::{
|
||||
auth::{
|
||||
checks::is_visible_organization, filter_visible_collections,
|
||||
@@ -23,7 +24,6 @@ use crate::{
|
||||
use actix_web::{HttpRequest, HttpResponse, web};
|
||||
use ariadne::ids::UserId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
use validator::Validate;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
@@ -422,7 +422,7 @@ pub async fn user_edit(
|
||||
username,
|
||||
id as crate::database::models::ids::DBUserId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
} else {
|
||||
return Err(ApiError::InvalidInput(format!(
|
||||
@@ -441,7 +441,7 @@ pub async fn user_edit(
|
||||
bio.as_deref(),
|
||||
id as crate::database::models::ids::DBUserId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ pub async fn user_edit(
|
||||
role,
|
||||
id as crate::database::models::ids::DBUserId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ pub async fn user_edit(
|
||||
badges.bits() as i64,
|
||||
id as crate::database::models::ids::DBUserId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ pub async fn user_edit(
|
||||
venmo_handle,
|
||||
id as crate::database::models::ids::DBUserId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ pub async fn user_edit(
|
||||
allow_friend_requests,
|
||||
id as crate::database::models::ids::DBUserId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
use super::project_creation::{CreateError, UploadedFile};
|
||||
use crate::auth::get_user_from_headers;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::PgTransaction;
|
||||
use crate::database::models::loader_fields::{
|
||||
LoaderField, LoaderFieldEnumValue, VersionField,
|
||||
};
|
||||
@@ -35,7 +37,6 @@ use hex::ToHex;
|
||||
use itertools::Itertools;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha1::Digest;
|
||||
use sqlx::postgres::PgPool;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
use validator::Validate;
|
||||
@@ -149,7 +150,7 @@ pub async fn version_create(
|
||||
async fn version_create_inner(
|
||||
req: HttpRequest,
|
||||
payload: &mut Multipart,
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
redis: &RedisPool,
|
||||
file_host: &dyn FileHost,
|
||||
uploaded_files: &mut Vec<UploadedFile>,
|
||||
@@ -213,7 +214,7 @@ async fn version_create_inner(
|
||||
let project_id: models::DBProjectId = version_create_data.project_id.unwrap().into();
|
||||
|
||||
// Ensure that the project this version is being added to exists
|
||||
if models::DBProject::get_id(project_id, &mut **transaction, redis)
|
||||
if models::DBProject::get_id(project_id, &mut *transaction, redis)
|
||||
.await?
|
||||
.is_none()
|
||||
{
|
||||
@@ -228,14 +229,14 @@ async fn version_create_inner(
|
||||
project_id,
|
||||
user.id.into(),
|
||||
false,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?;
|
||||
|
||||
// Get organization attached, if exists, and the member project permissions
|
||||
let organization = models::DBOrganization::get_associated_organization_project_id(
|
||||
project_id,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -243,7 +244,7 @@ async fn version_create_inner(
|
||||
models::DBTeamMember::get_from_user_id(
|
||||
organization.team_id,
|
||||
user.id.into(),
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?
|
||||
} else {
|
||||
@@ -266,7 +267,7 @@ async fn version_create_inner(
|
||||
let version_id: VersionId = models::generate_version_id(transaction).await?.into();
|
||||
|
||||
let all_loaders =
|
||||
models::loader_fields::Loader::list(&mut **transaction, redis).await?;
|
||||
models::loader_fields::Loader::list(&mut *transaction, redis).await?;
|
||||
let loaders = version_create_data
|
||||
.loaders
|
||||
.iter()
|
||||
@@ -282,10 +283,10 @@ async fn version_create_inner(
|
||||
let loader_ids: Vec<models::LoaderId> = loaders.iter().map(|y| y.id).collect_vec();
|
||||
|
||||
let loader_fields =
|
||||
LoaderField::get_fields(&loader_ids, &mut **transaction, redis).await?;
|
||||
LoaderField::get_fields(&loader_ids, &mut *transaction, redis).await?;
|
||||
let mut loader_field_enum_values = LoaderFieldEnumValue::list_many_loader_fields(
|
||||
&loader_fields,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
redis,
|
||||
)
|
||||
.await?;
|
||||
@@ -402,7 +403,7 @@ async fn version_create_inner(
|
||||
",
|
||||
builder.project_id as crate::database::models::ids::DBProjectId
|
||||
)
|
||||
.fetch(&mut **transaction)
|
||||
.fetch(&mut *transaction)
|
||||
.map_ok(|m| models::ids::DBUserId(m.follower_id))
|
||||
.try_collect::<Vec<models::ids::DBUserId>>()
|
||||
.await?;
|
||||
@@ -479,7 +480,7 @@ async fn version_create_inner(
|
||||
|
||||
for image_id in version_data.uploaded_images {
|
||||
if let Some(db_image) =
|
||||
image_item::DBImage::get(image_id.into(), &mut **transaction, redis)
|
||||
image_item::DBImage::get(image_id.into(), &mut *transaction, redis)
|
||||
.await?
|
||||
{
|
||||
let image: Image = db_image.into();
|
||||
@@ -500,7 +501,7 @@ async fn version_create_inner(
|
||||
version_id.0 as i64,
|
||||
image_id.0 as i64
|
||||
)
|
||||
.execute(&mut **transaction)
|
||||
.execute(&mut *transaction)
|
||||
.await?;
|
||||
|
||||
image_item::DBImage::clear_cache(image.id.into(), redis).await?;
|
||||
@@ -580,7 +581,7 @@ async fn upload_file_to_version_inner(
|
||||
req: HttpRequest,
|
||||
payload: &mut Multipart,
|
||||
client: Data<PgPool>,
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
redis: Data<RedisPool>,
|
||||
file_host: &dyn FileHost,
|
||||
uploaded_files: &mut Vec<UploadedFile>,
|
||||
@@ -609,7 +610,7 @@ async fn upload_file_to_version_inner(
|
||||
};
|
||||
|
||||
let all_loaders =
|
||||
models::loader_fields::Loader::list(&mut **transaction, &redis).await?;
|
||||
models::loader_fields::Loader::list(&mut *transaction, &redis).await?;
|
||||
let selected_loaders = version
|
||||
.loaders
|
||||
.iter()
|
||||
@@ -624,7 +625,7 @@ async fn upload_file_to_version_inner(
|
||||
|
||||
if models::DBProject::get_id(
|
||||
version.inner.project_id,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
&redis,
|
||||
)
|
||||
.await?
|
||||
@@ -640,7 +641,7 @@ async fn upload_file_to_version_inner(
|
||||
version.inner.project_id,
|
||||
user.id.into(),
|
||||
false,
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -656,7 +657,7 @@ async fn upload_file_to_version_inner(
|
||||
models::DBTeamMember::get_from_user_id(
|
||||
organization.team_id,
|
||||
user.id.into(),
|
||||
&mut **transaction,
|
||||
&mut *transaction,
|
||||
)
|
||||
.await?
|
||||
} else {
|
||||
@@ -798,7 +799,7 @@ pub async fn upload_file(
|
||||
force_primary: bool,
|
||||
file_type: Option<FileType>,
|
||||
other_file_names: Vec<String>,
|
||||
transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
|
||||
transaction: &mut PgTransaction<'_>,
|
||||
redis: &RedisPool,
|
||||
) -> Result<(), CreateError> {
|
||||
let (file_name, file_extension) = get_name_ext(content_disposition)?;
|
||||
@@ -838,7 +839,7 @@ pub async fn upload_file(
|
||||
"sha1",
|
||||
project_id.0 as i64
|
||||
)
|
||||
.fetch_one(&mut **transaction)
|
||||
.fetch_one(&mut *transaction)
|
||||
.await?
|
||||
.exists
|
||||
.unwrap_or(false);
|
||||
@@ -883,7 +884,7 @@ pub async fn upload_file(
|
||||
",
|
||||
&*hashes
|
||||
)
|
||||
.fetch_all(&mut **transaction)
|
||||
.fetch_all(&mut *transaction)
|
||||
.await?;
|
||||
|
||||
for file in &format.files {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use super::ApiError;
|
||||
use crate::auth::checks::{filter_visible_versions, is_visible_version};
|
||||
use crate::auth::{filter_visible_projects, get_user_from_headers};
|
||||
use crate::database::PgPool;
|
||||
use crate::database::ReadOnlyPgPool;
|
||||
use crate::database::redis::RedisPool;
|
||||
use crate::models::ids::VersionId;
|
||||
@@ -14,7 +15,6 @@ use dashmap::DashMap;
|
||||
use futures::TryStreamExt;
|
||||
use itertools::Itertools;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
@@ -696,7 +696,7 @@ pub async fn delete_file(
|
||||
",
|
||||
row.id.0
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
sqlx::query!(
|
||||
@@ -706,7 +706,7 @@ pub async fn delete_file(
|
||||
",
|
||||
row.id.0,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
transaction.commit().await?;
|
||||
|
||||
@@ -6,6 +6,7 @@ use crate::auth::checks::{
|
||||
};
|
||||
use crate::auth::get_user_from_headers;
|
||||
use crate::database;
|
||||
use crate::database::PgPool;
|
||||
use crate::database::models::loader_fields::{
|
||||
self, LoaderField, LoaderFieldEnumValue, VersionField,
|
||||
};
|
||||
@@ -32,7 +33,6 @@ use actix_web::{HttpRequest, HttpResponse, web};
|
||||
use ariadne::ids::base62_impl::parse_base62;
|
||||
use itertools::Itertools;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
use validator::Validate;
|
||||
|
||||
pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
@@ -361,7 +361,7 @@ pub async fn version_edit_helper(
|
||||
name.trim(),
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ pub async fn version_edit_helper(
|
||||
number,
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ pub async fn version_edit_helper(
|
||||
version_type.as_str(),
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ pub async fn version_edit_helper(
|
||||
",
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
let builders = dependencies
|
||||
@@ -429,7 +429,7 @@ pub async fn version_edit_helper(
|
||||
.collect::<Vec<String>>();
|
||||
|
||||
let all_loaders =
|
||||
loader_fields::Loader::list(&mut *transaction, &redis)
|
||||
loader_fields::Loader::list(&mut transaction, &redis)
|
||||
.await?;
|
||||
let loader_ids = version_item
|
||||
.loaders
|
||||
@@ -444,7 +444,7 @@ pub async fn version_edit_helper(
|
||||
|
||||
let loader_fields = LoaderField::get_fields(
|
||||
&loader_ids,
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
&redis,
|
||||
)
|
||||
.await?
|
||||
@@ -465,13 +465,13 @@ pub async fn version_edit_helper(
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
&loader_field_ids
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
let mut loader_field_enum_values =
|
||||
LoaderFieldEnumValue::list_many_loader_fields(
|
||||
&loader_fields,
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
&redis,
|
||||
)
|
||||
.await?;
|
||||
@@ -509,7 +509,7 @@ pub async fn version_edit_helper(
|
||||
",
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
let mut loader_versions = Vec::new();
|
||||
@@ -517,7 +517,7 @@ pub async fn version_edit_helper(
|
||||
let loader_id =
|
||||
database::models::loader_fields::Loader::get_id(
|
||||
&loader.0,
|
||||
&mut *transaction,
|
||||
&mut transaction,
|
||||
&redis,
|
||||
)
|
||||
.await?
|
||||
@@ -554,7 +554,7 @@ pub async fn version_edit_helper(
|
||||
featured,
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -568,7 +568,7 @@ pub async fn version_edit_helper(
|
||||
body,
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -588,7 +588,7 @@ pub async fn version_edit_helper(
|
||||
*downloads as i32,
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
|
||||
let diff = *downloads - (version_item.inner.downloads as u32);
|
||||
@@ -603,7 +603,7 @@ pub async fn version_edit_helper(
|
||||
version_item.inner.project_id
|
||||
as database::models::ids::DBProjectId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -623,7 +623,7 @@ pub async fn version_edit_helper(
|
||||
status.as_str(),
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
@@ -656,7 +656,7 @@ pub async fn version_edit_helper(
|
||||
result.id,
|
||||
file_type.file_type.as_ref().map(|x| x.as_str()),
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
@@ -671,7 +671,7 @@ pub async fn version_edit_helper(
|
||||
ordering.to_owned() as Option<i32>,
|
||||
version_id as database::models::ids::DBVersionId,
|
||||
)
|
||||
.execute(&mut *transaction)
|
||||
.execute(&mut transaction)
|
||||
.await?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user