diff --git a/server-api/db/src/channels.rs b/server-api/db/src/channels.rs index 8842dd7..97c9473 100644 --- a/server-api/db/src/channels.rs +++ b/server-api/db/src/channels.rs @@ -22,6 +22,12 @@ impl FromDB for Channel { type Row = Option<(UBigInt, VarChar, Option, Integer)>; async fn get(p: &Pool, id: UBigInt) -> Response { + //! Retrieves a Full single Channel row from the DB or fails in a + //! fashion described by crate::Response + //! @param p -> SqlPool + //! @param id -> UBigInt + //! @return on_success -> Response::Row(Channel) + //! @return on_fail -> Response::{Empty, Other} if let Ok(conn) = p.get_conn().await { let q = "SELECT id, name, description, kind FROM channels WHERE id = :id"; let result: Result<(Conn, Self::Row), SqlError> = @@ -44,6 +50,11 @@ impl FromDB for Channel { } async fn update(p: &Pool, row: Self) -> Response { + //! Updates a whole single based on a given Row Of Channel Type + //! @param p -> SqlPool + //! @param row -> Channel + //! @return on_success -> Response::Success + //! @return on_failure -> Response::Other if let Ok(conn) = p.get_conn().await { let q = "UPDATE channels SET name = :name, description = :desc, kind = :kind @@ -64,6 +75,11 @@ impl FromDB for Channel { } async fn delete(p: &Pool, id: UBigInt) -> Response { + //! Deletes channel given UBigInt as the row key + //! @param p -> SqlPool + //! @param id -> UBigInt + //! @return on_success -> Response::Success + //! @return on_failure -> Response::Other if let Ok(conn) = p.get_conn().await { let q = "DELETE FROM channels WHERE id = :id"; let result: Result = diff --git a/server-api/db/src/messages.rs b/server-api/db/src/messages.rs index 1a81109..b995d59 100644 --- a/server-api/db/src/messages.rs +++ b/server-api/db/src/messages.rs @@ -5,7 +5,7 @@ use mysql_async::error::Error as SqlError; use async_trait::async_trait; use crate::{Response, no_conn, sql_err}; -use crate::{UBigInt, BigInt, Integer, VarChar}; +use crate::{UBigInt, BigInt, VarChar}; use crate::common::{FromDB};