mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-26 04:24:21 +01:00
Merge 'sqlite3: Add in-memory support to sqlite3_open()' from Pekka Enberg
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #606
This commit is contained in:
@@ -112,9 +112,15 @@ pub unsafe extern "C" fn sqlite3_open(
|
||||
Ok(s) => s,
|
||||
Err(_) => return SQLITE_MISUSE,
|
||||
};
|
||||
let io = match limbo_core::PlatformIO::new() {
|
||||
Ok(io) => Arc::new(io),
|
||||
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,
|
||||
},
|
||||
_ => match limbo_core::PlatformIO::new() {
|
||||
Ok(io) => Arc::new(io),
|
||||
Err(_) => return SQLITE_MISUSE,
|
||||
},
|
||||
};
|
||||
match limbo_core::Database::open_file(io, filename) {
|
||||
Ok(db) => {
|
||||
|
||||
Reference in New Issue
Block a user