launchbadge/sqlx
Auf GitHub ansehenExtend derive(FromRow) with additional features/attributes
Open
#156 geöffnet am 26. März 2020
E-mediumenhancementgood first issuehelp wanted
Repository-Metriken
- Stars
- (13.916 Stars)
- PR-Merge-Metriken
- (Keine gemergten PRs in 30 T)
Beschreibung
-
Handle
#[sqlx(rename = "new_name")]on a struct field -
Support the derive on a tuple struct and use by ordinal retrieval from the row
-
Handle
#[sqlx(ordinal = 3)]to use ordinal retrieval from the row (row.get(3)) -
Handle a field that is
impl FromRow. A parallel fromserde_jsonwould perhaps make this#[sqlx(flatten)].#[derive(sqlx::FromRow)] struct Bar { baz: i32 // row.get("baz") } #[derive(sqlx::FromRow)] struct Foo { foo: i32, // row.get("foo") #[sqlx(flatten)] bar: Bar }