I have my entities in a separate crate and all functions return a Select.
I also have a few helper functions in my "main" crate and one of them should count.
The method is the following:
pub async fn count<T: EntityTrait>(select_stm: Select<T>) -> Result<u64, ApiError>
where
T: Send + Sized,
{
let total = select_stm.count(get_database_connection()).await.map_err(ApiError::from)?;
Ok(total)
}
But I am getting the following error message:
In fact I can't use any function in my function.
I asked on the discord but nobody was able to help me.
Steps to Reproduce
Create a helper function like shown above.
Try to compile
See the errors
Expected Behavior
Better documentation on covering this edge case or just working out of the box.
Actual Behavior
Compiling errors
Reproduces How Often
Everytime.
Should be easy to reproduce or show me the error I am doing.
Workarounds
None (almost).
Fetch all entries and simply count in rust. (Heavy load on the database).
My current "workaround":
Maybe this is a bug maybe I just don't know enough about rust.
I tried a lot of things I cannot find a solution, so if this is my error please show me how to fix this
Description
I have my entities in a separate crate and all functions return a Select.
I also have a few helper functions in my "main" crate and one of them should count.
The method is the following:
But I am getting the following error message:
![image](https://github.com/SeaQL/sea-orm/assets/83671398/6339289c-e8ff-4dd5-a0d8-47f0eea10f02)
In fact I can't use any function in my function. I asked on the discord but nobody was able to help me.
Steps to Reproduce
Expected Behavior
Better documentation on covering this edge case or just working out of the box.
Actual Behavior
Compiling errors
Reproduces How Often
Everytime. Should be easy to reproduce or show me the error I am doing.
Workarounds
None (almost). Fetch all entries and simply count in rust. (Heavy load on the database). My current "workaround":
I wouldn't call this a workaround as it does something completly different.
Reproducible Example
Just add the method as it is a compile error there is no "need" for an actual example.
Versions
Rust: 1.75.0 Sea-Orm: 0.12.12 OS: Fedora 39 (and Alpine 3.19)