mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-02 17:22:17 +00:00
tree_create -> btree_create
This commit is contained in:
parent
569e98cb32
commit
9f72655e30
5 changed files with 6 additions and 6 deletions
|
@ -88,7 +88,7 @@ impl Cursor for PseudoCursor {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_tree(&mut self, _flags: usize) -> u32 {
|
fn btree_create(&mut self, _flags: usize) -> u32 {
|
||||||
unreachable!("Please don't.")
|
unreachable!("Please don't.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1677,7 +1677,7 @@ impl Cursor for BTreeCursor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_tree(&mut self, flags: usize) -> u32 {
|
fn btree_create(&mut self, flags: usize) -> u32 {
|
||||||
let page_type = match flags {
|
let page_type = match flags {
|
||||||
1 => PageType::TableLeaf,
|
1 => PageType::TableLeaf,
|
||||||
2 => PageType::IndexLeaf,
|
2 => PageType::IndexLeaf,
|
||||||
|
|
|
@ -441,5 +441,5 @@ pub trait Cursor {
|
||||||
fn exists(&mut self, key: &OwnedValue) -> Result<CursorResult<bool>>;
|
fn exists(&mut self, key: &OwnedValue) -> Result<CursorResult<bool>>;
|
||||||
fn set_null_flag(&mut self, flag: bool);
|
fn set_null_flag(&mut self, flag: bool);
|
||||||
fn get_null_flag(&self) -> bool;
|
fn get_null_flag(&self) -> bool;
|
||||||
fn create_tree(&mut self, flags: usize) -> u32;
|
fn btree_create(&mut self, flags: usize) -> u32;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2127,7 +2127,7 @@ impl Program {
|
||||||
self.database_header.clone(),
|
self.database_header.clone(),
|
||||||
));
|
));
|
||||||
|
|
||||||
let root_page = cursor.create_tree(1);
|
let root_page = cursor.btree_create(1);
|
||||||
state.registers[*root] = OwnedValue::Integer(root_page as i64);
|
state.registers[*root] = OwnedValue::Integer(root_page as i64);
|
||||||
state.pc += 1;
|
state.pc += 1;
|
||||||
}
|
}
|
||||||
|
@ -2826,7 +2826,7 @@ mod tests {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_tree(&mut self, _flags: usize) -> u32 {
|
fn btree_create(&mut self, _flags: usize) -> u32 {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ impl Cursor for Sorter {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_tree(&mut self, _flags: usize) -> u32 {
|
fn btree_create(&mut self, _flags: usize) -> u32 {
|
||||||
unreachable!("Why did you try to build a new tree with a sorter??? Stand up, open the door and take a walk for 30 min to come back with a better plan.");
|
unreachable!("Why did you try to build a new tree with a sorter??? Stand up, open the door and take a walk for 30 min to come back with a better plan.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue