mirror of
https://github.com/isar/rusqlite.git
synced 2025-10-24 01:38:54 +08:00
Add query_row_named for prepared statement.
This commit is contained in:
@@ -537,9 +537,7 @@ impl Connection {
|
||||
F: FnOnce(&Row<'_>) -> Result<T>,
|
||||
{
|
||||
let mut stmt = self.prepare(sql)?;
|
||||
let mut rows = stmt.query_named(params)?;
|
||||
|
||||
rows.get_expected_row().and_then(|r| f(&r))
|
||||
stmt.query_row_named(params, f)
|
||||
}
|
||||
|
||||
/// Convenience method to execute a query that is expected to return a
|
||||
|
Reference in New Issue
Block a user