terry90 / diesel_filter

Diesel filtering & pagination
Apache License 2.0
13 stars 7 forks source link

Use with diesel_async #4

Open Ducky2048 opened 11 months ago

Ducky2048 commented 11 months ago

First of all thank you for this crate!

I tried to use it in a project, but it didn't work, because the macro generates code depending on the sync versions of diesel traits. I am using diesel_async (this means AsyncPgConnection instead of PgConnection, for example).

I've never written Rust macros but I could try to expand it with a feature to work with diesel_async. Would this be something you'd be interested in?

I also noticed it doesn't emit use statements for the things it uses, is this on purpose? If not, is it ok if I add those too? Mostly for convenience.

Thanks!

terry90 commented 11 months ago

I'm not using diesel_async for the moment but it would be a nice addition.

Feel free to submit a PR ! I'll be glad to add support for it.

measproem commented 11 months ago

I faced the sample problem diesel_async too really need it! I am new on Rust

diesel_async::RunQueryDsl<AsyncPgConnection>

I tried but error conflicted diesel_async::RunQueryDsl :

error[E0119]: conflicting implementations of trait `diesel_async::RunQueryDsl<AsyncPgConnection>` for type `Paginated<_>`  
--> diesel_filter/core/src/pagination.rs:92:1
 |
 92 | impl<T> RunQueryDsl<AsyncPgConnection> for Paginated<T> {}
 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 |
 = note: conflicting implementation in crate `diesel_async`:
       - impl<T, Conn> diesel_async::RunQueryDsl<Conn> for T;`
Ducky2048 commented 11 months ago

I'm still planning on implementing this, but it won't be soon, because I have a lot of work at the moment

measproem commented 11 months ago

Thank I have forked and update to support Async+DeadPool It works but not yet test all