diff --git a/src/lib.rs b/src/lib.rs
index cee734f..ebee3a3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -54,6 +54,8 @@
#![warn(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]
+pub use fallible_iterator;
+pub use fallible_streaming_iterator;
pub use libsqlite3_sys as ffi;
use std::cell::RefCell;
@@ -1095,7 +1097,13 @@ impl fmt::Debug for Connection {
}
}
-/// Batch iterator
+/// Batch fallible iterator
+///
+/// # Warning
+///
+/// There is no recovery on parsing error, when a invalid statement is found in `sql`, SQLite cannot jump to the next statement.
+/// So you should break the loop when an error is raised by the `next` method.
+///
/// ```rust
/// use rusqlite::{Batch, Connection, Result};
///
@@ -1124,12 +1132,16 @@ impl<'conn, 'sql> Batch<'conn, 'sql> {
pub fn new(conn: &'conn Connection, sql: &'sql str) -> Self {
Batch { conn, sql, tail: 0 }
}
+}
+impl<'conn> fallible_iterator::FallibleIterator for Batch<'conn, '_> {
+ type Error = Error;
+ type Item = Statement<'conn>;
/// Iterates on each batch statements.
///
/// Returns `Ok(None)` when batch is completed.
#[expect(clippy::should_implement_trait)] // fallible iterator
- pub fn next(&mut self) -> Result