mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-20 23:45:18 +01:00
Add comments to clarify current behaviour
This commit is contained in:
@@ -51,6 +51,7 @@ pub use io::{
|
||||
use limbo_sqlite3_parser::{ast, ast::Cmd, lexer::sql::Parser};
|
||||
use parking_lot::RwLock;
|
||||
use schema::Schema;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
cell::{Cell, RefCell, UnsafeCell},
|
||||
@@ -175,6 +176,8 @@ impl Database {
|
||||
open_flags: flags,
|
||||
};
|
||||
let db = Arc::new(db);
|
||||
|
||||
// Check: https://github.com/tursodatabase/limbo/pull/1761#discussion_r2154013123
|
||||
if db_size > 0 || wal_has_frames {
|
||||
// parse schema
|
||||
let conn = db.connect()?;
|
||||
|
||||
@@ -564,6 +564,8 @@ impl Pager {
|
||||
|
||||
#[inline(always)]
|
||||
pub fn begin_write_tx(&self) -> Result<LimboResult> {
|
||||
// TODO(Diego): The only possibly allocate page1 here is because OpenEphemeral needs a write transaction
|
||||
// we should have a unique API to begin transactions, something like sqlite3BtreeBeginTrans
|
||||
while self.is_empty.load(Ordering::SeqCst) {
|
||||
let _lock = self.init_lock.lock().unwrap();
|
||||
self.allocate_page1()?;
|
||||
|
||||
Reference in New Issue
Block a user