diff --git a/app-server/src/db/machine_manager.rs b/app-server/src/db/machine_manager.rs index ab956b5..d220c1f 100644 --- a/app-server/src/db/machine_manager.rs +++ b/app-server/src/db/machine_manager.rs @@ -3,23 +3,19 @@ use sqlx::PgPool; use uuid::Uuid; pub async fn create_machine(pool: &PgPool, machine_id: Uuid, project_id: Uuid) -> Result<()> { - sqlx::query!( - r"INSERT INTO machines (id, project_id) VALUES ($1, $2)", - machine_id, - project_id - ) - .execute(pool) - .await?; + sqlx::query("INSERT INTO machines (id, project_id) VALUES ($1, $2)") + .bind(machine_id) + .bind(project_id) + .execute(pool) + .await?; Ok(()) } pub async fn delete_machine(pool: &PgPool, machine_id: Uuid, project_id: Uuid) -> Result<()> { - sqlx::query!( - r"DELETE FROM machines WHERE id = $1 AND project_id = $2", - machine_id, - project_id - ) - .execute(pool) - .await?; + sqlx::query("DELETE FROM machines WHERE id = $1 AND project_id = $2") + .bind(machine_id) + .bind(project_id) + .execute(pool) + .await?; Ok(()) } diff --git a/app-server/src/machine_manager/mod.rs b/app-server/src/machine_manager/mod.rs index 51b7ee8..62de354 100644 --- a/app-server/src/machine_manager/mod.rs +++ b/app-server/src/machine_manager/mod.rs @@ -4,7 +4,6 @@ use anyhow::Result; use async_trait::async_trait; use machine_manager_service_client::MachineManagerServiceClient; pub use machine_manager_service_grpc::*; -use sqlx::pool; use std::sync::Arc; use tonic::transport::Channel; use uuid::Uuid;