Skip to content

Commit 85e3056

Browse files
committed
Introduced new FromRow method
Workaround for [Rorm #33](rorm-orm/rorm#33)
1 parent 695b51c commit 85e3056

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/row.rs

+8
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ const _: () = {
6262
pub trait FromRow: Sized {
6363
/// Try decoding a [row](Row) into `Self`.
6464
fn from_row(row: Row) -> Result<Self, Error>;
65+
66+
/// A version of [from_row](FromRow::from_row) which uses the columns positions instead of names.
67+
/// This is a work-around until [mariaDB](https://github.com/rorm-orm/rorm/issues/33) is fixed.
68+
fn from_row_using_position(row: Row) -> Result<Self, Error>;
6569
}
6670

6771
macro_rules! impl_from_row {
@@ -79,6 +83,10 @@ macro_rules! impl_from_row {
7983
)+
8084
))
8185
}
86+
87+
fn from_row_using_position(row: Row) -> Result<Self, Error> {
88+
Self::from_row(row)
89+
}
8290
}
8391
};
8492
}

0 commit comments

Comments
 (0)