Cleaned up imports.
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::database::{
|
||||
common::{Delete, Upsert},
|
||||
dtos::recurring_transaction::RecurringTransactionRow,
|
||||
};
|
||||
use super::dtos::{Delete, RecurringTransactionRow, Upsert};
|
||||
|
||||
pub struct Query {
|
||||
pub limit: Option<i64>,
|
||||
pub offset: Option<i64>,
|
||||
}
|
||||
|
||||
pub async fn query_recurring_transactions<'e, E>(
|
||||
pub async fn query<'e, E>(
|
||||
executor: E,
|
||||
query: Query,
|
||||
) -> Result<Vec<RecurringTransactionRow>, sqlx::Error>
|
||||
@@ -41,7 +38,7 @@ where
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_recurring_transaction_by_id<'e, E>(
|
||||
pub async fn get_by_id<'e, E>(
|
||||
executor: E,
|
||||
id: Uuid,
|
||||
) -> Result<Option<RecurringTransactionRow>, sqlx::Error>
|
||||
@@ -70,7 +67,7 @@ where
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn upsert_recurring_transaction<'e, E>(
|
||||
pub async fn upsert<'e, E>(
|
||||
executor: E,
|
||||
transaction: RecurringTransactionRow,
|
||||
) -> Result<Upsert<RecurringTransactionRow>, sqlx::Error>
|
||||
@@ -144,10 +141,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn delete_recurring_transaction_by_id<'e, E>(
|
||||
executor: E,
|
||||
id: Uuid,
|
||||
) -> Result<Delete, sqlx::Error>
|
||||
pub async fn delete_by_id<'e, E>(executor: E, id: Uuid) -> Result<Delete, sqlx::Error>
|
||||
where
|
||||
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user