mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-07 10:14:21 +01:00
rename functions
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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>() {
|
||||
|
||||
Reference in New Issue
Block a user