diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index 085d71b3b..16afc5494 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -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::(format!("Step error: {:?}", e)))? - .eq(&limbo_core::StepResult::IO) - { - self.conn - .io - .run_once() - .map_err(|e| PyErr::new::(format!("IO error: {:?}", e)))?; + loop { + match stmt.borrow_mut().step().map_err(|e| { + PyErr::new::(format!("Step error: {:?}", e)) + })? { + limbo_core::StepResult::IO => { + self.conn.io.run_once().map_err(|e| { + PyErr::new::(format!("IO error: {:?}", e)) + })?; + } + _ => break, + } } } diff --git a/core/lib.rs b/core/lib.rs index d02312dbc..73afafb29 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -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>, -} +pub type Row<'a> = types::Record<'a>; impl<'a> Row<'a> { pub fn get + 'a>(&self, idx: usize) -> Result {