Skip to content

DeriveEntityModel types don't implement TryGetable trait when wrapped in a Vec #2967

@sinder38

Description

@sinder38

Description

DeriveEntityModel types (wrapped types) don't implement TryGetable trait when wrapped in a Vec, which is needed for postgres-array

Steps to Reproduce

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, DeriveValueType)]
pub struct GoodId(i32);

#[derive(FromQueryResult, Debug, Clone)]
pub struct TreeRow {
	pub ingredient_path: Vec<GoodId>,
}

Expected Behavior

no error

Actual Behavior

Error:

the trait bound `Vec<GoodID>: TryGetable` is not satisfied
the following other types implement trait `TryGetable`:
  Vec<Braced>
  Vec<Hyphenated>
  Vec<JsonValue>
  Vec<NaiveDate>
  Vec<NaiveDateTime>
  Vec<NaiveTime>
  Vec<OffsetDateTime>
  Vec<PrimitiveDateTime>
and 22 others

Reproduces How Often

every time

Workarounds

manual implementation of the trait will work probably

Versions

this one:
e36eea4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions