Skip to content

Commit b730d59

Browse files
xx01cyxlanlou1554
authored andcommitted
add comments
1 parent 49f600a commit b730d59

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

optd-persistent/src/cost_model/catalog/mock_catalog.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use serde_json::json;
33

44
use crate::cost_model::interface::{AttrType, IndexType, StatType};
55

6+
/// TODO: documentation
67
pub struct MockDatabaseMetadata {
78
pub id: i32,
89
pub name: String,
@@ -33,7 +34,6 @@ pub struct MockAttribute {
3334
pub struct MockStatistic {
3435
pub id: i32,
3536
pub stat_type: i32,
36-
// TODO(lanlou): what should I use for the value type?
3737
pub stat_value: Json,
3838
pub attr_ids: Vec<i32>,
3939
pub table_id: Option<i32>,
@@ -74,7 +74,9 @@ pub struct MockCatalog {
7474
pub triggers: Vec<MockTrigger>,
7575
// TODO: constraints
7676
}
77+
7778
impl MockCatalog {
79+
/// TODO: documentation
7880
pub fn new() -> Self {
7981
let databases: Vec<MockDatabaseMetadata> = vec![MockDatabaseMetadata {
8082
id: 1,

optd-persistent/src/cost_model/orm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ impl CostModelStorageLayer for BackendManager {
177177
)
178178
.exec(&transaction)
179179
.await?;
180+
// TODO: initialize constraints
180181
}
181182
CatalogSource::Iceberg() => todo!(),
182183
}

optd-persistent/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ mod migrator;
1313
pub mod cost_model;
1414
pub use cost_model::interface::CostModelStorageLayer;
1515

16+
/// The filename of the SQLite database for migration.
1617
pub const DATABASE_FILENAME: &str = "sqlite.db";
18+
/// The URL of the SQLite database for migration.
1719
pub const DATABASE_URL: &str = "sqlite:./sqlite.db?mode=rwc";
1820

21+
/// The filename of the SQLite database for testing.
1922
pub const TEST_DATABASE_FILENAME: &str = "init.db";
23+
/// The URL of the SQLite database for testing.
2024
pub static TEST_DATABASE_FILE: LazyLock<String> = LazyLock::new(|| {
2125
std::env::current_dir()
2226
.unwrap()
@@ -27,6 +31,7 @@ pub static TEST_DATABASE_FILE: LazyLock<String> = LazyLock::new(|| {
2731
.unwrap()
2832
.to_owned()
2933
});
34+
/// The URL of the SQLite database for testing.
3035
pub static TEST_DATABASE_URL: LazyLock<String> =
3136
LazyLock::new(|| get_sqlite_url(TEST_DATABASE_FILE.as_str()));
3237

0 commit comments

Comments
 (0)