SeaQL / SeaQL/sea-orm

v1.1.2: cannot find method or associated constant `enum_type_name` in trait `sea_orm::sea_query::ValueType

Open
#2,444 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area:docs Category:enhancement
Dominant language
Rust
Stars
9.9k
Forks
734
Avg merge
6h 36m
Merged PRs (30d)
8

Description

Description

I'm trying to upgrade from 1.1.1 to 1.1.2 and keep getting these errors, for every single field definition on the generated pub struct Model:

error[E0576]: cannot find method or associated constant `enum_type_name` in trait `sea_orm::sea_query::ValueType`
  --> .../src/db/entities/templates.rs:22:5
   |
22 |     #[sea_orm(column_type = "Text", nullable)]
   |     ^ not found in `sea_orm::sea_query::ValueType`

I'm assuming that it's not an issue with my code, specially considering that this is a patch version bump.

Steps to Reproduce

  1. Generate code using sea-orm-cli
  2. Get rustc errors when checking/building the code.
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "templates")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i64,
    #[sea_orm(column_type = "Text")]
    pub label: String,
    #[sea_orm(column_type = "Text", nullable)]
    pub description: Option<String>,
    // ...
}
Expected Behavior

No rustc errors, similar to 1.1.1.

Actual Behavior

(see above)

Reproduces How Often

Always. Tried cleaning up the build env, still the same.

Workarounds

Not aware of any.

Reproducible Example

My code-gen script is:

sea-orm-cli generate entity \
  -o $ENTITIES_ROOT \
  --with-copy-enums \
  --with-serde both \
  --ignore-tables=schema_info

Versions

│   ├── sea-orm v1.1.2
│   │   ├── sea-orm-macros v1.1.2 (proc-macro)
│   │   │   ├── sea-bae v0.2.1 (proc-macro)
│   │   ├── sea-query v0.32.0
│   │   ├── sea-query-binder v0.7.0
│   │   │   ├── sea-query v0.32.0 (*)
├── sea-orm v1.1.2 (*)

Command-line:

≥ sea-orm-cli --version
sea-orm-cli 1.1.2

Cargo.toml:

sea-orm = { version = "1.1.2", features = [
  "sqlx-postgres",
  "runtime-tokio-rustls",
  "macros",
  "postgres-array",
] }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated src/db/entities/templates.rs model and the Cargo.toml dependency features, then reproduce the failure using the provided sea-orm-cli generate entity command. Compare the generated output and compilation behavior between SeaORM 1.1.1 and 1.1.2; done means generated entities build without the enum_type_name error.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgres, rust
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.