Skip to content

Commit

Permalink
Implement NamedRow changes for mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Jun 10, 2020
1 parent 43d9d8a commit c8bfe3b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion diesel/src/mysql/connection/stmt/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ impl<'a> NamedStatementIterator<'a> {
Ok(Some(())) => Some(Ok(NamedMysqlRow {
binds: &self.output_binds,
column_indices: self.metadata.column_indices(),
metadata: &self.metadata,
})),
Ok(None) => None,
Err(e) => Some(Err(e)),
Expand All @@ -129,6 +130,7 @@ impl<'a> NamedStatementIterator<'a> {
pub struct NamedMysqlRow<'a> {
binds: &'a Binds,
column_indices: &'a HashMap<&'a str, usize>,
metadata: &'a StatementMetadata,
}

impl<'a> NamedRow<Mysql> for NamedMysqlRow<'a> {
Expand All @@ -141,6 +143,11 @@ impl<'a> NamedRow<Mysql> for NamedMysqlRow<'a> {
}

fn field_names(&self) -> Vec<&str> {
todo!()
self.metadata
.fields()
.iter()
.filter_map(|f| f.field_name())
.collect()
}
}

0 comments on commit c8bfe3b

Please sign in to comment.