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

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

Open
behnam-oneschema opened this issue Dec 10, 2024 · 3 comments

Comments

@behnam-oneschema
Copy link

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",
] }
@behnam-oneschema
Copy link
Author

From the closing comment on #2437, it sounds like it might have something to do with a missing dep version bump, maybe on sea-query?

@behnam-oneschema
Copy link
Author

Yep, I just confirmed that bump sea-query to the latest version resolves the issue.

I guess the proper solution for other users of sea-orm would be another patch-version bump for sea-orm (to 1.1.3) which would include a dep version bump for sea-query to 0.32.1.

Anyways, I'm unblocked. But leaving this issue open for anyone else who might face this.

@Fenex
Copy link

Fenex commented Dec 13, 2024

I got the same error when I was trying to downgrade from 1.1.2 to 1.1.1. In my case I forgot to downgrade sea-orm-macros.

Btw, if you got this or similar error, you need be sure correct versions in dependencies: sea-orm, sea-orm-migration, sea-orm-macros, sea-query and maybe others.

yaleman added a commit to yaleman/maremma that referenced this issue Dec 15, 2024
github-actions bot pushed a commit to yaleman/maremma that referenced this issue Dec 15, 2024
)

* chore(deps): bump the all group across 1 directory with 10 updates

Bumps the all group with 10 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [chrono](https://github.com/chronotope/chrono) | `0.4.38` | `0.4.39` |
| [clap](https://github.com/clap-rs/clap) | `4.5.21` | `4.5.23` |
| [rustls](https://github.com/rustls/rustls) | `0.23.19` | `0.23.20` |
| [serde](https://github.com/serde-rs/serde) | `1.0.215` | `1.0.216` |
| [sea-orm](https://github.com/SeaQL/sea-orm) | `1.1.1` | `1.1.2` |
| [sea-orm-migration](https://github.com/SeaQL/sea-orm) | `1.1.1` | `1.1.2` |
| [time](https://github.com/time-rs/time) | `0.3.36` | `0.3.37` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.41.1` | `1.42.0` |
| [tokio-rustls](https://github.com/rustls/tokio-rustls) | `0.26.0` | `0.26.1` |
| [tower](https://github.com/tower-rs/tower) | `0.5.1` | `0.5.2` |



Updates `chrono` from 0.4.38 to 0.4.39
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](chronotope/chrono@v0.4.38...v0.4.39)

Updates `clap` from 4.5.21 to 4.5.23
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@clap_complete-v4.5.21...clap_complete-v4.5.23)

Updates `rustls` from 0.23.19 to 0.23.20
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](rustls/rustls@v/0.23.19...v/0.23.20)

Updates `serde` from 1.0.215 to 1.0.216
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.215...v1.0.216)

Updates `sea-orm` from 1.1.1 to 1.1.2
- [Release notes](https://github.com/SeaQL/sea-orm/releases)
- [Changelog](https://github.com/SeaQL/sea-orm/blob/master/CHANGELOG.md)
- [Commits](SeaQL/sea-orm@1.1.1...1.1.2)

Updates `sea-orm-migration` from 1.1.1 to 1.1.2
- [Release notes](https://github.com/SeaQL/sea-orm/releases)
- [Changelog](https://github.com/SeaQL/sea-orm/blob/master/CHANGELOG.md)
- [Commits](SeaQL/sea-orm@1.1.1...1.1.2)

Updates `time` from 0.3.36 to 0.3.37
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](time-rs/time@v0.3.36...v0.3.37)

Updates `tokio` from 1.41.1 to 1.42.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-1.41.1...tokio-1.42.0)

Updates `tokio-rustls` from 0.26.0 to 0.26.1
- [Release notes](https://github.com/rustls/tokio-rustls/releases)
- [Commits](https://github.com/rustls/tokio-rustls/commits)

Updates `tower` from 0.5.1 to 0.5.2
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](tower-rs/tower@tower-0.5.1...tower-0.5.2)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: sea-orm
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: sea-orm-migration
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: time
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: tokio-rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: tower
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(update): adding sea-query as an explicit dependency to fix update issue ref SeaQL/sea-orm#2444

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
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