Skip to content

Commit

Permalink
patch rusqlite Connection open_with_wal*
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinPostma committed Nov 9, 2023
1 parent 6da931b commit 7ac6378
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 1 addition & 3 deletions vendored/rusqlite/src/inner_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ impl InnerConnection {
Some(create_wal) => {
ffi::libsql_open(c_path.as_ptr(), &mut db, flags.bits(), z_vfs, create_wal)
}
None => {
ffi::sqlite3_open_v2(c_path.as_ptr(), &mut db, flags.bits(), z_vfs)
}
None => ffi::sqlite3_open_v2(c_path.as_ptr(), &mut db, flags.bits(), z_vfs),
};

if r != ffi::SQLITE_OK {
Expand Down
9 changes: 5 additions & 4 deletions vendored/rusqlite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,12 @@ impl Connection {
flags: OpenFlags,
create_wal: libsql_sys::ffi::libsql_create_wal,
) -> Result<Connection> {

let c_path = path_to_cstring(path.as_ref())?;
InnerConnection::open_with_flags(&c_path, flags, None, Some(create_wal)).map(|db| Connection {
db: RefCell::new(db),
cache: StatementCache::with_capacity(STATEMENT_CACHE_DEFAULT_CAPACITY),
InnerConnection::open_with_flags(&c_path, flags, None, Some(create_wal)).map(|db| {
Connection {
db: RefCell::new(db),
cache: StatementCache::with_capacity(STATEMENT_CACHE_DEFAULT_CAPACITY),
}
})
}

Expand Down

0 comments on commit 7ac6378

Please sign in to comment.