mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-08 09:44:21 +01:00
core: Unify Row and Record structs
They're exactly the same thing.
This commit is contained in:
@@ -101,16 +101,17 @@ impl Cursor {
|
||||
// For DDL and DML statements,
|
||||
// we need to execute the statement immediately
|
||||
if stmt_is_ddl || stmt_is_dml {
|
||||
while stmt
|
||||
.borrow_mut()
|
||||
.step()
|
||||
.map_err(|e| PyErr::new::<OperationalError, _>(format!("Step error: {:?}", e)))?
|
||||
.eq(&limbo_core::StepResult::IO)
|
||||
{
|
||||
self.conn
|
||||
.io
|
||||
.run_once()
|
||||
.map_err(|e| PyErr::new::<OperationalError, _>(format!("IO error: {:?}", e)))?;
|
||||
loop {
|
||||
match stmt.borrow_mut().step().map_err(|e| {
|
||||
PyErr::new::<OperationalError, _>(format!("Step error: {:?}", e))
|
||||
})? {
|
||||
limbo_core::StepResult::IO => {
|
||||
self.conn.io.run_once().map_err(|e| {
|
||||
PyErr::new::<OperationalError, _>(format!("IO error: {:?}", e))
|
||||
})?;
|
||||
}
|
||||
_ => break,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +498,7 @@ impl Statement {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug)]
|
||||
pub enum StepResult<'a> {
|
||||
Row(Row<'a>),
|
||||
IO,
|
||||
@@ -507,10 +507,7 @@ pub enum StepResult<'a> {
|
||||
Busy,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct Row<'a> {
|
||||
pub values: Vec<Value<'a>>,
|
||||
}
|
||||
pub type Row<'a> = types::Record<'a>;
|
||||
|
||||
impl<'a> Row<'a> {
|
||||
pub fn get<T: types::FromValue<'a> + 'a>(&self, idx: usize) -> Result<T> {
|
||||
|
||||
Reference in New Issue
Block a user