mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 10:08:20 +00:00
core: parse unary and write to disk
This commit is contained in:
parent
d795a7a3ba
commit
53c348402a
5 changed files with 146 additions and 18 deletions
11
core/lib.rs
11
core/lib.rs
|
@ -46,7 +46,11 @@ impl Database {
|
|||
pub fn open(io: Rc<dyn crate::io::IO>, page_source: PageSource) -> Result<Database> {
|
||||
let db_header = Pager::begin_open(&page_source)?;
|
||||
io.run_once()?;
|
||||
let pager = Rc::new(Pager::finish_open(db_header.clone(), page_source)?);
|
||||
let pager = Rc::new(Pager::finish_open(
|
||||
db_header.clone(),
|
||||
page_source,
|
||||
io.clone(),
|
||||
)?);
|
||||
let bootstrap_schema = Rc::new(Schema::new());
|
||||
let conn = Connection {
|
||||
pager: pager.clone(),
|
||||
|
@ -128,13 +132,14 @@ impl Connection {
|
|||
pub fn update_pragma(&self, name: &String, value: i64) {
|
||||
match name.as_str() {
|
||||
"cache_size" => {
|
||||
// update in disk
|
||||
|
||||
// update in-memory header
|
||||
self.header.borrow_mut().default_cache_size = value
|
||||
.try_into()
|
||||
.expect(&format!("invalid value, too big for a i32 {}", value));
|
||||
|
||||
// update in disk
|
||||
self.pager.write_database_header(&self.header.borrow());
|
||||
|
||||
// update cache size
|
||||
}
|
||||
_ => todo!(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue