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

GraphQl query with postgress enums #139

Open
vlccek opened this issue Aug 5, 2023 · 1 comment
Open

GraphQl query with postgress enums #139

vlccek opened this issue Aug 5, 2023 · 1 comment

Comments

@vlccek
Copy link

vlccek commented Aug 5, 2023

Description

Generating project with seaography-cli from postgress db. When I try to get data from the table with an enum, the server panic.

Steps to Reproduce

  1. Create a table with postgress enum
  2. Try to query some data from that table from graphql interface.

Versions

├── sea-orm v0.10.7
│   ├── sea-orm-macros v0.10.7 (proc-macro)
│   ├── sea-query v0.27.2
│   │   ├── sea-query-derive v0.2.0 (proc-macro)
│   ├── sea-query-binder v0.2.2
│   │   ├── sea-query v0.27.2 (*)
│   ├── sea-strum v0.23.0
│   │   └── sea-strum_macros v0.23.0 (proc-macro)
├── seaography v0.3.0
│   ├── sea-orm v0.10.7 (*)
│   └── seaography-derive v0.3.0 (proc-macro)

Additional Information

Server output:

Rust type `core::option::Option<alloc::string::String>` (as SQL type `TEXT`) is not compatible with SQL type `_foodcategoryenum`" }))

Problematic column:

    #[sea_orm(column_type = "Custom(\"array\".to_owned())", nullable)]
    pub category: Option<String>,

I even try to replace this definition by

 pub category: Option<Vec<Foodcategoryenum>>,

but it will not compile because

the trait `From<Vec<Foodcategoryenum>>` is not implemented for `sea_orm::Value`
@karatakis
Copy link
Collaborator

Thanks for taking the time to report this issue. I will schedule it to be delivered in later versions.

@karatakis karatakis added this to the Good to have features milestone Aug 7, 2023
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

2 participants