add test + implement sqlite3_column_int64 for test

This commit is contained in:
pedrocarlo
2025-07-01 23:05:32 -03:00
parent db005c81a0
commit 44b8275b26
2 changed files with 122 additions and 2 deletions

View File

@@ -561,8 +561,15 @@ pub unsafe extern "C" fn sqlite3_column_name(
}
#[no_mangle]
pub unsafe extern "C" fn sqlite3_column_int64(_stmt: *mut sqlite3_stmt, _idx: ffi::c_int) -> i64 {
stub!();
pub unsafe extern "C" fn sqlite3_column_int64(stmt: *mut sqlite3_stmt, idx: ffi::c_int) -> i64 {
// Attempt to convert idx to usize
let idx = idx.try_into().unwrap();
let stmt = &mut *stmt;
let row = stmt
.stmt
.row()
.expect("Function should only be called after `SQLITE_ROW`");
row.get(idx).unwrap()
}
#[no_mangle]
@@ -1188,6 +1195,13 @@ pub unsafe extern "C" fn libsql_wal_get_frame(
}
}
/// Disable WAL checkpointing.
///
/// Note: This function disables WAL checkpointing entirely, including when
/// the last database connection is closed. This is different from
/// sqlite3_wal_autocheckpoint() which only disables automatic checkpoints
/// for the current connection, but still allows checkpointing when the
/// connection is closed.
#[no_mangle]
pub unsafe extern "C" fn libsql_wal_disable_checkpoint(db: *mut sqlite3) -> ffi::c_int {
if db.is_null() {