Skip to content

Commit d83bde3

Browse files
committed
Revert "add memo trait"
This reverts commit 9b74ff7.
1 parent 9b74ff7 commit d83bde3

File tree

6 files changed

+2
-467
lines changed

6 files changed

+2
-467
lines changed

optd-persistent/src/lib.rs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ mod migrator;
1313
pub mod cost_model;
1414
pub use cost_model::interface::CostModelStorageLayer;
1515

16-
mod memo;
17-
pub use memo::interface::Memo;
18-
1916
/// The filename of the SQLite database for migration.
2017
pub const DATABASE_FILENAME: &str = "sqlite.db";
2118
/// The URL of the SQLite database for migration.
@@ -42,29 +39,18 @@ fn get_sqlite_url(file: &str) -> String {
4239
format!("sqlite:{}?mode=rwc", file)
4340
}
4441

42+
pub type StorageResult<T> = Result<T, BackendError>;
43+
4544
#[derive(Debug)]
4645
pub enum CostModelError {
4746
// TODO: Add more error types
4847
UnknownStatisticType,
4948
VersionedStatisticNotFound,
5049
}
5150

52-
/// TODO convert this to `thiserror`
53-
#[derive(Debug)]
54-
/// The different kinds of errors that might occur while running operations on a memo table.
55-
pub enum MemoError {
56-
UnknownGroup,
57-
UnknownLogicalExpression,
58-
UnknownPhysicalExpression,
59-
InvalidExpression,
60-
Database(DbErr),
61-
}
62-
63-
/// TODO convert this to `thiserror`
6451
#[derive(Debug)]
6552
pub enum BackendError {
6653
CostModel(CostModelError),
67-
Memo(MemoError),
6854
Database(DbErr),
6955
// TODO: Add other variants as needed for different error types
7056
}
@@ -75,27 +61,12 @@ impl From<CostModelError> for BackendError {
7561
}
7662
}
7763

78-
impl From<MemoError> for BackendError {
79-
fn from(value: MemoError) -> Self {
80-
BackendError::Memo(value)
81-
}
82-
}
83-
8464
impl From<DbErr> for BackendError {
8565
fn from(value: DbErr) -> Self {
8666
BackendError::Database(value)
8767
}
8868
}
8969

90-
impl From<DbErr> for MemoError {
91-
fn from(value: DbErr) -> Self {
92-
MemoError::Database(value)
93-
}
94-
}
95-
96-
/// A type alias for a result with [`BackendError`] as the error type.
97-
pub type StorageResult<T> = Result<T, BackendError>;
98-
9970
pub struct BackendManager {
10071
db: DatabaseConnection,
10172
}

optd-persistent/src/main.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ use optd_persistent::DATABASE_URL;
1717

1818
#[tokio::main]
1919
async fn main() {
20-
basic_demo().await;
21-
memo_demo().await;
22-
}
23-
24-
async fn memo_demo() {
25-
let _db = Database::connect(DATABASE_URL).await.unwrap();
26-
27-
todo!()
28-
}
29-
30-
async fn basic_demo() {
3120
let db = Database::connect(DATABASE_URL).await.unwrap();
3221

3322
// Create a new `CascadesGroup`.

optd-persistent/src/memo/expression.rs

Lines changed: 0 additions & 73 deletions
This file was deleted.

optd-persistent/src/memo/interface.rs

Lines changed: 0 additions & 138 deletions
This file was deleted.

optd-persistent/src/memo/mod.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)