You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rocket_sync_db_pools currently relies on diesel 1.4, which is going out of support, and it's currently giving some problems with uuid 1.0.0.
diesel 1.4 supports up to uuid 0.8 and rocket 0.5.0-rc has functionalities for uuid 1.0, creating a conflict: if I want to use uuid::Uuid in the models, I must use version 0.8, but, if I want a uuid in a route, I must use rocket::serde::uuid::Uuid, which isn't compatible with the diesel implementation. To handle this problem, I downgraded the uuid version to 0.8, and created a conversion function:
Which means I must manually use it everytime I want to use a Uuid in a request_:
#[get("/<id>")]pubasyncfnget_id(id: rocket::serde::uuid::Uuid,db:Db) -> Json<User>{let id = to_uuid(id).unwrap();
...}
It also means that I have to handle 2 Uuids in my code, which can be confusing in some parts.
The other problem is that the 1.4.x won't be supported anymore, so it would be really useful to transition to 2.0.0 as soon as it's ready.
The current version is missing some of the new functionalities like group by, table aliasing, "Selectable" trait, union, intersect and except.
A clear and concise description of existing functionality and why it is insufficient. Examples:
Suggested Changes
I still haven't looked at the code to find a solution, and it would still be too soon to upgrade to the new version, as it's not fully ready yet.
Alternatives Considered
I've tried to implement the Poolable trait for diesel 2.0.0's PgConnection inside my project, but it's really complex, as I can't directly implement the trait to diesel::PgConnection due to the orphan rule.
I can implement Poolable only if I wrap diesel::PgConnection with a custom struct
pubstructConnection(diesel::PgConnection);
But I manually have to implement a custom manager, and all the other traits diesel:PgConnection uses.
diesel 2.0.0 it's still not ready, I suggest waiting before trying to implement anything. I would also be glad to hear some suggestions, or the problems this feature can create.
The text was updated successfully, but these errors were encountered:
I'd be in favor of adding support under a diesel-2 feature flag or similar, leaving the current support in tact. Please submit a PR doing so, using the existing implementation and docs for diesel's present support as a baseline for this implementation. Remember to update all relevant docs including the crate-level docs indicating support for this feature and any relevant guide docs.
The fix for using postgres and diesel 2 has not been published as a new version of the crate yet, so we are at the whims of the current master branch
rwf2/Rocket#2209
Existing Functionality
rocket_sync_db_pools
currently relies ondiesel 1.4
, which is going out of support, and it's currently giving some problems withuuid 1.0.0
.diesel 1.4
supports up touuid 0.8
and rocket0.5.0-rc
has functionalities foruuid 1.0
, creating a conflict: if I want to useuuid::Uuid
in the models, I must use version 0.8, but, if I want a uuid in a route, I must userocket::serde::uuid::Uuid
, which isn't compatible with the diesel implementation. To handle this problem, I downgraded the uuid version to 0.8, and created a conversion function:Which means I must manually use it everytime I want to use a Uuid in a request_:
1.4.x
won't be supported anymore, so it would be really useful to transition to2.0.0
as soon as it's ready.A clear and concise description of existing functionality and why it is insufficient. Examples:
Suggested Changes
I still haven't looked at the code to find a solution, and it would still be too soon to upgrade to the new version, as it's not fully ready yet.
Alternatives Considered
I've tried to implement the
Poolable
trait fordiesel 2.0.0
'sPgConnection
inside my project, but it's really complex, as I can't directly implement the trait todiesel::PgConnection
due to the orphan rule.I can implement
Poolable
only if I wrap diesel::PgConnection with a custom structBut I manually have to implement a custom manager, and all the other traits
diesel:PgConnection
uses.Additional Context
diesel 2.0.0
it's still not ready, I suggest waiting before trying to implement anything. I would also be glad to hear some suggestions, or the problems this feature can create.The text was updated successfully, but these errors were encountered: