File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use serde_json::json;
33
44use crate :: cost_model:: interface:: { AttrType , IndexType , StatType } ;
55
6+ /// TODO: documentation
67pub struct MockDatabaseMetadata {
78 pub id : i32 ,
89 pub name : String ,
@@ -33,7 +34,6 @@ pub struct MockAttribute {
3334pub 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+
7778impl MockCatalog {
79+ /// TODO: documentation
7880 pub fn new ( ) -> Self {
7981 let databases: Vec < MockDatabaseMetadata > = vec ! [ MockDatabaseMetadata {
8082 id: 1 ,
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change @@ -13,10 +13,14 @@ mod migrator;
1313pub mod cost_model;
1414pub use cost_model:: interface:: CostModelStorageLayer ;
1515
16+ /// The filename of the SQLite database for migration.
1617pub const DATABASE_FILENAME : & str = "sqlite.db" ;
18+ /// The URL of the SQLite database for migration.
1719pub const DATABASE_URL : & str = "sqlite:./sqlite.db?mode=rwc" ;
1820
21+ /// The filename of the SQLite database for testing.
1922pub const TEST_DATABASE_FILENAME : & str = "init.db" ;
23+ /// The URL of the SQLite database for testing.
2024pub 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.
3035pub static TEST_DATABASE_URL : LazyLock < String > =
3136 LazyLock :: new ( || get_sqlite_url ( TEST_DATABASE_FILE . as_str ( ) ) ) ;
3237
You can’t perform that action at this time.
0 commit comments