Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vec<RoleEnum> in SeaORM Entity Model Causes Compilation Error #2331

Closed
LokiSharp opened this issue Aug 15, 2024 · 1 comment
Closed

Vec<RoleEnum> in SeaORM Entity Model Causes Compilation Error #2331

LokiSharp opened this issue Aug 15, 2024 · 1 comment

Comments

@LokiSharp
Copy link

Description

I am encountering an error when trying to use Vec<RoleEnum> with sea-orm's DeriveEntityModel macro. The error message indicates that the method into_value exists for ActiveValue<Vec<RoleEnum>>, but its trait bounds were not satisfied.

Steps to Reproduce

  1. Use the CLI command to generate the entity:
    sea-orm-cli generate entity -u postgres://postgres:postgres@db:5432/postgres -o entity/src -l --with-serde both --serde-skip-deserializing-primary-key
  2. Use Vec<RoleEnum> as a field in a struct that derives DeriveEntityModel.
  3. Run the build command:
    cargo build --manifest-path crates/entity/Cargo.toml

Expected Behavior

The Vec<RoleEnum> should be correctly converted to sea_orm::Value and work seamlessly with DeriveEntityModel, but sea-orm-cli does not generate the necessary trait implementations.

Actual Behavior

The compiler throws an error indicating that sea_orm::Value: From<Vec> is not satisfied, and thus Vec cannot be converted into sea_orm::Value.

Additional Information

//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "role_enum")]
pub enum RoleEnum {
    #[sea_orm(string_value = "admin")]
    Admin,
    #[sea_orm(string_value = "user")]
    User,
}
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.0

use super::sea_orm_active_enums::RoleEnum;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "user")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    #[serde(skip_deserializing)]
    pub id: Uuid,
    #[sea_orm(unique)]
    pub email: String,
    #[sea_orm(unique)]
    pub username: String,
    pub password: String,
    pub roles: Vec<RoleEnum>,
    pub status: i32,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(has_many = "super::worker::Entity")]
    Worker,
}

impl Related<super::worker::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::Worker.def()
    }
}

impl ActiveModelBehavior for ActiveModel {}
dev ➜ /workspaces/workerd-manager (master) $ cargo build --manifest-path crates/entity/Cargo.toml
   Compiling entity v0.1.0 (/workspaces/workerd-manager/crates/entity)
error[E0277]: the trait bound `sea_orm::Value: From<Vec<RoleEnum>>` is not satisfied
  --> crates/entity/src/user.rs:7:35
   |
7  | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
   |                                   ^^^^^^^^^^^^^^^^^ the trait `From<Vec<RoleEnum>>` is not implemented for `sea_orm::Value`, which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
   |
   = help: the following other types implement trait `From<T>`:
             <sea_orm::Value as From<&[u8]>>
             <sea_orm::Value as From<&std::string::String>>
             <sea_orm::Value as From<&str>>
             <sea_orm::Value as From<Cow<'_, str>>>
             <sea_orm::Value as From<JsonValue>>
             <sea_orm::Value as From<Vec<u8>>>
             <sea_orm::Value as From<bool>>
             <sea_orm::Value as From<char>>
           and 29 others
   = note: required for `Vec<RoleEnum>` to implement `Into<sea_orm::Value>`
note: required by a bound in `ActiveValue`
  --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-orm-1.0.0/src/entity/active_model.rs:42:8
   |
40 | pub enum ActiveValue<V>
   |          ----------- required by a bound in this enum
41 | where
42 |     V: Into<Value>,
   |        ^^^^^^^^^^^ required by this bound in `ActiveValue`
   = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Vec<RoleEnum>: ValueType` is not satisfied
  --> crates/entity/src/user.rs:18:5
   |
18 |     pub roles: Vec<RoleEnum>,
   |     ^^^ the trait `ValueType` is not implemented for `Vec<RoleEnum>`
   |
   = help: the trait `ValueType` is implemented for `Vec<u8>`

error[E0277]: the trait bound `Vec<RoleEnum>: TryGetable` is not satisfied
  --> crates/entity/src/user.rs:7:35
   |
7  | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
   |                                   ^^^^^^^^^^^^^^^^^ the trait `TryGetable` is not implemented for `Vec<RoleEnum>`
   |
   = help: the following other types implement trait `TryGetable`:
             Vec<T>
             Vec<u8>
note: required by a bound in `QueryResult::try_get`
  --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-orm-1.0.0/src/executor/query.rs:93:12
   |
91 |     pub fn try_get<T>(&self, pre: &str, col: &str) -> Result<T, DbErr>
   |            ------- required by a bound in this associated function
92 |     where
93 |         T: TryGetable,
   |            ^^^^^^^^^^ required by this bound in `QueryResult::try_get`
   = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `sea_orm::Value: From<Vec<RoleEnum>>` is not satisfied
 --> crates/entity/src/user.rs:7:35
  |
7 | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
  |                                   ^^^^^^^^^^^^^^^^^ the trait `From<Vec<RoleEnum>>` is not implemented for `sea_orm::Value`, which is required by `Vec<RoleEnum>: Into<_>`
  |
  = help: the following other types implement trait `From<T>`:
            <sea_orm::Value as From<&[u8]>>
            <sea_orm::Value as From<&std::string::String>>
            <sea_orm::Value as From<&str>>
            <sea_orm::Value as From<Cow<'_, str>>>
            <sea_orm::Value as From<JsonValue>>
            <sea_orm::Value as From<Vec<u8>>>
            <sea_orm::Value as From<bool>>
            <sea_orm::Value as From<char>>
          and 29 others
  = note: required for `Vec<RoleEnum>` to implement `Into<sea_orm::Value>`
  = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Vec<RoleEnum>: ValueType` is not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ the trait `ValueType` is not implemented for `Vec<RoleEnum>`
    |
    = help: the trait `ValueType` is implemented for `Vec<u8>`
note: required by a bound in `sea_orm::Value::unwrap`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-query-0.31.0/src/value.rs:310:12
    |
308 |     pub fn unwrap<T>(self) -> T
    |            ------ required by a bound in this associated function
309 |     where
310 |         T: ValueType,
    |            ^^^^^^^^^ required by this bound in `Value::unwrap`
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `sea_orm::Value: From<Vec<RoleEnum>>` is not satisfied
 --> crates/entity/src/user.rs:7:35
  |
7 | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
  |                                   ^^^^^^^^^^^^^^^^^ the trait `From<Vec<RoleEnum>>` is not implemented for `sea_orm::Value`, which is required by `ActiveValue<Vec<RoleEnum>>: Clone`
  |
  = help: the following other types implement trait `From<T>`:
            <sea_orm::Value as From<&[u8]>>
            <sea_orm::Value as From<&std::string::String>>
            <sea_orm::Value as From<&str>>
            <sea_orm::Value as From<Cow<'_, str>>>
            <sea_orm::Value as From<JsonValue>>
            <sea_orm::Value as From<Vec<u8>>>
            <sea_orm::Value as From<bool>>
            <sea_orm::Value as From<char>>
          and 29 others
  = note: required for `Vec<RoleEnum>` to implement `Into<sea_orm::Value>`
  = note: required for `ActiveValue<Vec<RoleEnum>>` to implement `Clone`
  = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `sea_orm::Value: From<Vec<RoleEnum>>` is not satisfied
 --> crates/entity/src/user.rs:7:35
  |
7 | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
  |                                   ^^^^^^^^^^^^^^^^^ the trait `From<Vec<RoleEnum>>` is not implemented for `sea_orm::Value`, which is required by `ActiveValue<Vec<RoleEnum>>: Debug`
  |
  = help: the following other types implement trait `From<T>`:
            <sea_orm::Value as From<&[u8]>>
            <sea_orm::Value as From<&std::string::String>>
            <sea_orm::Value as From<&str>>
            <sea_orm::Value as From<Cow<'_, str>>>
            <sea_orm::Value as From<JsonValue>>
            <sea_orm::Value as From<Vec<u8>>>
            <sea_orm::Value as From<bool>>
            <sea_orm::Value as From<char>>
          and 29 others
  = note: required for `Vec<RoleEnum>` to implement `Into<sea_orm::Value>`
  = note: required for `ActiveValue<Vec<RoleEnum>>` to implement `Debug`
  = note: required for the cast from `&ActiveValue<Vec<RoleEnum>>` to `&dyn Debug`
  = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `ActiveValue<Vec<RoleEnum>>`
 --> crates/entity/src/user.rs:7:35
  |
7 | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
  |                                   ^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `sea_orm::Value: From<Vec<RoleEnum>>` is not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ the trait `From<Vec<RoleEnum>>` is not implemented for `sea_orm::Value`, which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
    |
    = help: the following other types implement trait `From<T>`:
              <sea_orm::Value as From<&[u8]>>
              <sea_orm::Value as From<&std::string::String>>
              <sea_orm::Value as From<&str>>
              <sea_orm::Value as From<Cow<'_, str>>>
              <sea_orm::Value as From<JsonValue>>
              <sea_orm::Value as From<Vec<u8>>>
              <sea_orm::Value as From<bool>>
              <sea_orm::Value as From<char>>
            and 29 others
    = note: required for `Vec<RoleEnum>` to implement `Into<sea_orm::Value>`
note: required by a bound in `ActiveValue::<V>::unchanged`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-orm-1.0.0/src/entity/active_model.rs:775:8
    |
775 |     V: Into<Value>,
    |        ^^^^^^^^^^^ required by this bound in `ActiveValue::<V>::unchanged`
...
788 |     pub fn unchanged(value: V) -> Self {
    |            --------- required by a bound in this associated function
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `into_wrapped_value` exists for enum `ActiveValue<Vec<RoleEnum>>`, but its trait bounds were not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ method cannot be called on `ActiveValue<Vec<RoleEnum>>` due to unsatisfied trait bounds
    |
   ::: /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-query-0.31.0/src/value.rs:132:1
    |
132 | pub enum Value {
    | -------------- doesn't satisfy `sea_orm::Value: From<Vec<RoleEnum>>`
    |
   ::: /usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:398:1
    |
398 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<RoleEnum>: Into<sea_orm::Value>`
    |
    = note: the following trait bounds were not satisfied:
            `sea_orm::Value: From<Vec<RoleEnum>>`
            which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `clone` exists for enum `ActiveValue<Vec<RoleEnum>>`, but its trait bounds were not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ method cannot be called on `ActiveValue<Vec<RoleEnum>>` due to unsatisfied trait bounds
    |
   ::: /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-orm-1.0.0/src/entity/active_model.rs:40:1
    |
40  | pub enum ActiveValue<V>
    | ----------------------- doesn't satisfy `ActiveValue<Vec<RoleEnum>>: Clone`
    |
   ::: /usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:398:1
    |
398 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<RoleEnum>: Into<sea_orm::Value>`
    |
    = note: the following trait bounds were not satisfied:
            `Vec<RoleEnum>: Into<sea_orm::Value>`
            which is required by `ActiveValue<Vec<RoleEnum>>: Clone`
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `sea_orm::Value: From<Vec<RoleEnum>>` is not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ the trait `From<Vec<RoleEnum>>` is not implemented for `sea_orm::Value`, which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
    |
    = help: the following other types implement trait `From<T>`:
              <sea_orm::Value as From<&[u8]>>
              <sea_orm::Value as From<&std::string::String>>
              <sea_orm::Value as From<&str>>
              <sea_orm::Value as From<Cow<'_, str>>>
              <sea_orm::Value as From<JsonValue>>
              <sea_orm::Value as From<Vec<u8>>>
              <sea_orm::Value as From<bool>>
              <sea_orm::Value as From<char>>
            and 29 others
    = note: required for `Vec<RoleEnum>` to implement `Into<sea_orm::Value>`
note: required by a bound in `ActiveValue::<V>::set`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-orm-1.0.0/src/entity/active_model.rs:775:8
    |
775 |     V: Into<Value>,
    |        ^^^^^^^^^^^ required by this bound in `ActiveValue::<V>::set`
...
778 |     pub fn set(value: V) -> Self {
    |            --- required by a bound in this associated function
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `sea_orm::Value: From<Vec<RoleEnum>>` is not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ the trait `From<Vec<RoleEnum>>` is not implemented for `sea_orm::Value`, which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
    |
    = help: the following other types implement trait `From<T>`:
              <sea_orm::Value as From<&[u8]>>
              <sea_orm::Value as From<&std::string::String>>
              <sea_orm::Value as From<&str>>
              <sea_orm::Value as From<Cow<'_, str>>>
              <sea_orm::Value as From<JsonValue>>
              <sea_orm::Value as From<Vec<u8>>>
              <sea_orm::Value as From<bool>>
              <sea_orm::Value as From<char>>
            and 29 others
    = note: required for `Vec<RoleEnum>` to implement `Into<sea_orm::Value>`
note: required by a bound in `ActiveValue::<V>::not_set`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-orm-1.0.0/src/entity/active_model.rs:775:8
    |
775 |     V: Into<Value>,
    |        ^^^^^^^^^^^ required by this bound in `ActiveValue::<V>::not_set`
...
798 |     pub fn not_set() -> Self {
    |            ------- required by a bound in this associated function
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `is_not_set` exists for enum `ActiveValue<Vec<RoleEnum>>`, but its trait bounds were not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ method cannot be called on `ActiveValue<Vec<RoleEnum>>` due to unsatisfied trait bounds
    |
   ::: /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-query-0.31.0/src/value.rs:132:1
    |
132 | pub enum Value {
    | -------------- doesn't satisfy `sea_orm::Value: From<Vec<RoleEnum>>`
    |
   ::: /usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:398:1
    |
398 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<RoleEnum>: Into<sea_orm::Value>`
    |
    = note: the following trait bounds were not satisfied:
            `sea_orm::Value: From<Vec<RoleEnum>>`
            which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `reset` exists for enum `ActiveValue<Vec<RoleEnum>>`, but its trait bounds were not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ method cannot be called on `ActiveValue<Vec<RoleEnum>>` due to unsatisfied trait bounds
    |
   ::: /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-query-0.31.0/src/value.rs:132:1
    |
132 | pub enum Value {
    | -------------- doesn't satisfy `sea_orm::Value: From<Vec<RoleEnum>>`
    |
   ::: /usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:398:1
    |
398 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<RoleEnum>: Into<sea_orm::Value>`
    |
    = note: the following trait bounds were not satisfied:
            `sea_orm::Value: From<Vec<RoleEnum>>`
            which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `sea_orm::Value: From<Vec<RoleEnum>>` is not satisfied
  --> crates/entity/src/user.rs:7:35
   |
7  | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
   |                                   ^^^^^^^^^^^^^^^^^ the trait `From<Vec<RoleEnum>>` is not implemented for `sea_orm::Value`, which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
   |
   = help: the following other types implement trait `From<T>`:
             <sea_orm::Value as From<&[u8]>>
             <sea_orm::Value as From<&std::string::String>>
             <sea_orm::Value as From<&str>>
             <sea_orm::Value as From<Cow<'_, str>>>
             <sea_orm::Value as From<JsonValue>>
             <sea_orm::Value as From<Vec<u8>>>
             <sea_orm::Value as From<bool>>
             <sea_orm::Value as From<char>>
           and 29 others
   = note: required for `Vec<RoleEnum>` to implement `Into<sea_orm::Value>`
note: required by a bound in `NotSet`
  --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-orm-1.0.0/src/entity/active_model.rs:42:8
   |
42 |     V: Into<Value>,
   |        ^^^^^^^^^^^ required by this bound in `NotSet`
...
49 |     NotSet,
   |     ------ required by a bound in this unit variant
   = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `into_value` exists for enum `ActiveValue<Vec<RoleEnum>>`, but its trait bounds were not satisfied
   --> crates/entity/src/user.rs:7:35
    |
7   | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^^^^^^^ method cannot be called on `ActiveValue<Vec<RoleEnum>>` due to unsatisfied trait bounds
    |
   ::: /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sea-query-0.31.0/src/value.rs:132:1
    |
132 | pub enum Value {
    | -------------- doesn't satisfy `sea_orm::Value: From<Vec<RoleEnum>>`
    |
   ::: /usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:398:1
    |
398 | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
    | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<RoleEnum>: Into<sea_orm::Value>`
    |
    = note: the following trait bounds were not satisfied:
            `sea_orm::Value: From<Vec<RoleEnum>>`
            which is required by `Vec<RoleEnum>: Into<sea_orm::Value>`
    = note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0277, E0369, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `entity` (lib) due to 20 previous errors

Versions

$ cargo tree | grep sea-
    │   ├── sea-orm v1.0.0
    │   │   ├── sea-orm-macros v1.0.0 (proc-macro)
    │   │   │   ├── sea-bae v0.2.0 (proc-macro)
    │   │   ├── sea-query v0.31.0
    │   │   │   ├── sea-query-derive v0.4.1 (proc-macro)
    │   │   ├── sea-query-binder v0.6.0
    │   │   │   ├── sea-query v0.31.0 (*)
    │   └── sea-orm-migration v1.0.0
    │       ├── sea-orm v1.0.0 (*)
    │       ├── sea-orm-cli v1.0.0
    │       │   ├── sea-schema v0.15.0
    │       │   │   ├── sea-query v0.31.0 (*)
    │       │   │   └── sea-schema-derive v0.3.0 (proc-macro)
    │       ├── sea-schema v0.15.0 (*)
    │   └── sea-orm v1.0.0 (*)
@LokiSharp
Copy link
Author

Fix by add features "postgres-array". PR #1210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant