mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-17 16:44:19 +01:00
make all run_once be run under statement or connection so that rollback is called
This commit is contained in:
@@ -16,7 +16,7 @@ fn test_last_insert_rowid_basic() -> anyhow::Result<()> {
|
||||
loop {
|
||||
match rows.step()? {
|
||||
StepResult::IO => {
|
||||
tmp_db.io.run_once()?;
|
||||
rows.run_once()?;
|
||||
}
|
||||
StepResult::Done => break,
|
||||
_ => unreachable!(),
|
||||
@@ -36,7 +36,7 @@ fn test_last_insert_rowid_basic() -> anyhow::Result<()> {
|
||||
}
|
||||
}
|
||||
StepResult::IO => {
|
||||
tmp_db.io.run_once()?;
|
||||
rows.run_once()?;
|
||||
}
|
||||
StepResult::Interrupt => break,
|
||||
StepResult::Done => break,
|
||||
@@ -50,7 +50,7 @@ fn test_last_insert_rowid_basic() -> anyhow::Result<()> {
|
||||
Ok(Some(ref mut rows)) => loop {
|
||||
match rows.step()? {
|
||||
StepResult::IO => {
|
||||
tmp_db.io.run_once()?;
|
||||
rows.run_once()?;
|
||||
}
|
||||
StepResult::Done => break,
|
||||
_ => unreachable!(),
|
||||
@@ -72,7 +72,7 @@ fn test_last_insert_rowid_basic() -> anyhow::Result<()> {
|
||||
}
|
||||
}
|
||||
StepResult::IO => {
|
||||
tmp_db.io.run_once()?;
|
||||
rows.run_once()?;
|
||||
}
|
||||
StepResult::Interrupt => break,
|
||||
StepResult::Done => break,
|
||||
@@ -101,7 +101,7 @@ fn test_integer_primary_key() -> anyhow::Result<()> {
|
||||
let mut insert_query = conn.query(query)?.unwrap();
|
||||
loop {
|
||||
match insert_query.step()? {
|
||||
StepResult::IO => tmp_db.io.run_once()?,
|
||||
StepResult::IO => insert_query.run_once()?,
|
||||
StepResult::Done => break,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
@@ -117,7 +117,7 @@ fn test_integer_primary_key() -> anyhow::Result<()> {
|
||||
rowids.push(*id);
|
||||
}
|
||||
}
|
||||
StepResult::IO => tmp_db.io.run_once()?,
|
||||
StepResult::IO => select_query.run_once()?,
|
||||
StepResult::Interrupt | StepResult::Done => break,
|
||||
StepResult::Busy => panic!("Database is busy"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user