diesel_async: Failed to find a type oid for ENUM_TYPE

Versions

  • Rust: 1.72
  • Diesel: 2.1
  • Diesel_async: 0.4.1
  • Database: postgresql
  • Operating System linux

Feature Flags

Problem Description

After I upgrade the code from diesel-async 0.3.x to 0.4, I faced this error: Failed to find a type oid for ENUM_TYPE. After I downgrade, the error disappeared. The only change in the code base was diesel-async version.

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Reactions: 2
  • Comments: 17 (8 by maintainers)

Most upvoted comments

As a temporary workaround it should be possible to just have a query at connection setup that does use that enum type and doesn’t use .eq_any(). That will prepopulate the cache and therefore workaround the cache miss in later queries. That’s not a real solution but it should unblock any user that is affected by this bug.

@omid This would be awesome and I’ll pass this message along. In the in between, I might be able to help with some code myself, if that’s useful for him or you. (:

@lsunsi please ask your company to sponsor @weiznich to push this forward 🙏🏼 and/or support him yourself

It’s on my list to address this at some point, but I cannot really make promises about the timeline. The problem is not that simple to solve is outlined in this comment. Essentially it boils down to the fact that we don’t want/cannot have a Send bound on the query for reasons but that makes it harder to evaluate futures borrowing that type. In the end it’s likely solvable by making the returned future conditional send based on the type parameters.

Thanks for providing this example. I can reproduce the issue with that.