diff --git a/optd-cost-model/src/cost/agg.rs b/optd-cost-model/src/cost/agg.rs index e69de29..8b13789 100644 --- a/optd-cost-model/src/cost/agg.rs +++ b/optd-cost-model/src/cost/agg.rs @@ -0,0 +1 @@ + diff --git a/optd-persistent/src/cost_model/orm.rs b/optd-persistent/src/cost_model/orm.rs index f2fde13..5b56476 100644 --- a/optd-persistent/src/cost_model/orm.rs +++ b/optd-persistent/src/cost_model/orm.rs @@ -453,10 +453,13 @@ impl CostModelStorageLayer for BackendManager { .collect::>(); if attr_ids.len() != attr_base_indices.len() { - return Err(BackendError::CostModel(format!( - "Not all attributes found for table_id {} and base indices {:?}", - table_id, attr_base_indices - ).into())); + return Err(BackendError::CostModel( + format!( + "Not all attributes found for table_id {} and base indices {:?}", + table_id, attr_base_indices + ) + .into(), + )); } self.get_stats_for_attr(attr_ids, stat_type, epoch_id).await @@ -508,10 +511,13 @@ impl CostModelStorageLayer for BackendManager { .one(&self.db) .await?; if expr_exists.is_none() { - return Err(BackendError::CostModel(format!( - "physical expression id {} not found when storing cost", - physical_expression_id - ).into())); + return Err(BackendError::CostModel( + format!( + "physical expression id {} not found when storing cost", + physical_expression_id + ) + .into(), + )); } // Check if epoch_id exists in Event table @@ -521,10 +527,9 @@ impl CostModelStorageLayer for BackendManager { .await .unwrap(); if epoch_exists.is_none() { - return Err(BackendError::CostModel(format!( - "epoch id {} not found when storing cost", - epoch_id - ).into())); + return Err(BackendError::CostModel( + format!("epoch id {} not found when storing cost", epoch_id).into(), + )); } let new_cost = plan_cost::ActiveModel { diff --git a/optd-persistent/src/migrator/memo/m20241029_000001_predicate.rs b/optd-persistent/src/migrator/memo/m20241029_000001_predicate.rs index d94df77..b4a58b9 100644 --- a/optd-persistent/src/migrator/memo/m20241029_000001_predicate.rs +++ b/optd-persistent/src/migrator/memo/m20241029_000001_predicate.rs @@ -6,7 +6,10 @@ Table predicate { } */ -use sea_orm_migration::{prelude::*, schema::{integer, json, pk_auto}}; +use sea_orm_migration::{ + prelude::*, + schema::{integer, json, pk_auto}, +}; #[derive(Iden)] pub enum Predicate { diff --git a/optd-persistent/src/migrator/memo/m20241029_000001_predicate_logical_expression_junction.rs b/optd-persistent/src/migrator/memo/m20241029_000001_predicate_logical_expression_junction.rs index 1e3b398..ab901d6 100644 --- a/optd-persistent/src/migrator/memo/m20241029_000001_predicate_logical_expression_junction.rs +++ b/optd-persistent/src/migrator/memo/m20241029_000001_predicate_logical_expression_junction.rs @@ -7,7 +7,9 @@ Table predicate_logical_expression_junction { use sea_orm_migration::{prelude::*, schema::integer}; -use super::{m20241029_000001_logical_expression::LogicalExpression, m20241029_000001_predicate::Predicate}; +use super::{ + m20241029_000001_logical_expression::LogicalExpression, m20241029_000001_predicate::Predicate, +}; #[derive(Iden)] pub enum PredicateLogicalExpressionJunction { @@ -19,7 +21,6 @@ pub enum PredicateLogicalExpressionJunction { #[derive(DeriveMigrationName)] pub struct Migration; - #[async_trait::async_trait] impl MigrationTrait for Migration { async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { @@ -53,18 +54,19 @@ impl MigrationTrait for Migration { Index::create() .col(PredicateLogicalExpressionJunction::LogicalExprId) .col(PredicateLogicalExpressionJunction::PredicateId), - ) .to_owned(), - ) + ) .await } async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { manager - .drop_table(Table::drop().table(PredicateLogicalExpressionJunction::Table).to_owned()) + .drop_table( + Table::drop() + .table(PredicateLogicalExpressionJunction::Table) + .to_owned(), + ) .await } -} - - +} diff --git a/optd-persistent/src/migrator/memo/m20241029_000001_predicate_physical_expression_junction.rs b/optd-persistent/src/migrator/memo/m20241029_000001_predicate_physical_expression_junction.rs index 7f134ed..8d82831 100644 --- a/optd-persistent/src/migrator/memo/m20241029_000001_predicate_physical_expression_junction.rs +++ b/optd-persistent/src/migrator/memo/m20241029_000001_predicate_physical_expression_junction.rs @@ -7,7 +7,9 @@ Table predicate_physical_expression_junction { use sea_orm_migration::{prelude::*, schema::integer}; -use super::{m20241029_000001_physical_expression::PhysicalExpression, m20241029_000001_predicate::Predicate}; +use super::{ + m20241029_000001_physical_expression::PhysicalExpression, m20241029_000001_predicate::Predicate, +}; #[derive(Iden)] pub enum PredicatePhysicalExpressionJunction {