Look up table root page from schema

This commit is contained in:
Pekka Enberg 2023-08-27 21:11:49 +03:00
parent 2615cdce2c
commit 3b53f48400
3 changed files with 83 additions and 45 deletions

View file

@ -15,12 +15,16 @@ impl Schema {
pub fn add_table(&mut self, name: String, table: Table) {
self.tables.insert(name, table);
}
pub fn get_table(&self, name: &str) -> Option<&Table> {
self.tables.get(name)
}
}
pub struct Table {
root_page: i32,
name: String,
columns: Vec<Column>,
pub root_page: usize,
pub name: String,
pub columns: Vec<Column>,
}
impl Table {