core: Unify StepResult structs

...also simplify Statement::step() to get some performance back.

Before:

```
Execute `SELECT 1`/Limbo
                        time:   [49.128 ns 50.425 ns 52.604 ns]
```

After:

```
Execute `SELECT 1`/Limbo
                        time:   [49.128 ns 50.425 ns 52.604 ns]
```
This commit is contained in:
Pekka Enberg 2025-02-05 09:06:17 +02:00
parent 7573fc62e6
commit 23cd8b10c3

View file

@ -467,14 +467,7 @@ impl Statement {
}
pub fn step(&mut self) -> Result<StepResult<'_>> {
let result = self.program.step(&mut self.state, self.pager.clone())?;
match result {
vdbe::StepResult::Row(row) => Ok(StepResult::Row(Row { values: row.values })),
vdbe::StepResult::IO => Ok(StepResult::IO),
vdbe::StepResult::Done => Ok(StepResult::Done),
vdbe::StepResult::Interrupt => Ok(StepResult::Interrupt),
vdbe::StepResult::Busy => Ok(StepResult::Busy),
}
self.program.step(&mut self.state, self.pager.clone())
}
pub fn columns(&self) -> &[String] {
@ -498,14 +491,7 @@ impl Statement {
}
}
#[derive(Debug)]
pub enum StepResult<'a> {
Row(Row<'a>),
IO,
Done,
Interrupt,
Busy,
}
pub type StepResult<'a> = vdbe::StepResult<'a>;
pub type Row<'a> = types::Record<'a>;