rename functions

This commit is contained in:
Mikaël Francoeur
2025-08-15 14:50:37 -04:00
parent 4a986080d2
commit 2ee0132afe
13 changed files with 307 additions and 328 deletions

View File

@@ -80,7 +80,7 @@ pub extern "C" fn rows_get_value(ctx: *mut c_void, col_idx: usize) -> *const c_v
if let Some(row) = ctx.stmt.row() {
if let Ok(value) = row.get::<&Value>(col_idx) {
return LimboValue::from_owned_value(value).to_ptr();
return LimboValue::from_db_value(value).to_ptr();
}
}
std::ptr::null()

View File

@@ -174,7 +174,7 @@ impl LimboValue {
Box::into_raw(Box::new(self)) as *const c_void
}
pub fn from_owned_value(value: &turso_core::Value) -> Self {
pub fn from_db_value(value: &turso_core::Value) -> Self {
match value {
turso_core::Value::Integer(i) => {
LimboValue::new(ValueType::Integer, ValueUnion::from_int(*i))

View File

@@ -84,7 +84,7 @@ impl Cursor {
let obj = params.into_bound(py);
for (i, elem) in obj.iter().enumerate() {
let value = py_to_owned_value(&elem)?;
let value = py_to_db_value(&elem)?;
stmt.borrow_mut()
.bind_at(NonZeroUsize::new(i + 1).unwrap(), value);
}
@@ -343,8 +343,8 @@ fn row_to_py(py: Python, row: &turso_core::Row) -> Result<PyObject> {
.into())
}
/// Converts a Python object to a Limbo Value
fn py_to_owned_value(obj: &Bound<PyAny>) -> Result<turso_core::Value> {
/// Converts a Python object to a Turso Value
fn py_to_db_value(obj: &Bound<PyAny>) -> Result<turso_core::Value> {
if obj.is_none() {
Ok(Value::Null)
} else if let Ok(integer) = obj.extract::<i64>() {