Make database Sync + Send

This commit is contained in:
Pere Diaz Bou
2025-03-04 10:40:59 +01:00
parent 205cd148ca
commit 8daf7666d1
34 changed files with 368 additions and 314 deletions

View File

@@ -110,10 +110,7 @@ pub unsafe extern "C" fn sqlite3_open(
Err(_) => return SQLITE_MISUSE,
};
let io: Arc<dyn limbo_core::IO> = match filename {
":memory:" => match limbo_core::MemoryIO::new() {
Ok(io) => Arc::new(io),
Err(_) => return SQLITE_MISUSE,
},
":memory:" => Arc::new(limbo_core::MemoryIO::new()),
_ => match limbo_core::PlatformIO::new() {
Ok(io) => Arc::new(io),
Err(_) => return SQLITE_MISUSE,
@@ -121,7 +118,7 @@ pub unsafe extern "C" fn sqlite3_open(
};
match limbo_core::Database::open_file(io, filename) {
Ok(db) => {
let conn = db.connect();
let conn = db.connect().unwrap();
*db_out = Box::leak(Box::new(sqlite3::new(db, conn)));
SQLITE_OK
}