Skip to content

Commit

Permalink
removed macros
Browse files Browse the repository at this point in the history
  • Loading branch information
skull8888888 committed Dec 27, 2024
1 parent 7bc33c6 commit d9a36aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
24 changes: 10 additions & 14 deletions app-server/src/db/machine_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
1 change: 0 additions & 1 deletion app-server/src/machine_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d9a36aa

Please sign in to comment.