mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +00:00

Unlike `Executor.fetch_optional()`, `Executor.fetch_many()` does not have a single exit. The stream can be dropped at any time. To catch this event, we create a `StatementResetter` structure inside the stream loop and reset the statement when it is dropped. A test case `it_resets_prepared_statement_after_fetch_many` is similar to `it_resets_prepared_statement_after_fetch_one` which tests `Executor.fetch_optional()`.