Remix.run Logo
newaccountman2 4 days ago

Oh cool, I will poke around Toasty. I am in the process of having LLM switch a project from some raw sqlx jank to Diesel, and mildly annoyed about some the boilerplate Diesel involves. Will have to see if Toasty solves it and whether it lets one query for arbitrary structs and add fields to structs from query results (e.g., in the README example for Toasty, explicitly joining on TODOs and mapping them to a simple field on the User objects as opposed to using ORM `has_many`)

> What pain points do you have in the Rust web framework ecosystem? Happy to hear.

I think I have more "gripes" than strong pain-points admittedly. Off the top of my head, complaints about boilerplate to simply access path params and JSON bodies.

Currently using Rocket, but it looks dead and unsupported. It's not perfect, but I like aspects of it, such as the global error handling and relative ease of accessing params.

Probably going to seem nitpicky, but compare these 2:

Rocket ``` #[get("/chat/threads/<thread_id>")] async fn get_thread(thread_id: Uuid) -> Result<Json<ThreadResponse>, AppError> ```

Actix ``` #[get("/{name}")] async fn hello(name: web::Path<String>) -> impl Responder ```

Why can't name just be String? Why can't `hello` endpoint just indicate clearly what it returns?

carllerche 3 days ago | parent [-]

> Will have to see if Toasty solves it and whether it lets one query for arbitrary structs and add fields to structs from query results (e.g., in the README example for Toasty, explicitly joining on TODOs and mapping them to a simple field on the User objects as opposed to using ORM `has_many`)

I'm not 100% following. Feel free to ping me in discord (https://discord.gg/tokio) or open an issue on Toasty and we can dig into it. Toasty is also pretty new, but maturing fast.

The other points are valid. There are challenges with extracting params and a type system. This is how topcoat does it: https://docs.rs/topcoat/latest/topcoat/router/attr.path_para...

newaccountman2 3 days ago | parent [-]

My "arbitrary structs" thing is exactly what Aeltoth was discussing in the Discord a couple days ago.

For the other part, I am basically saying I don't like, if one has a FK from Posts to Users, the ORM semantics of having user.posts automatically eagerly populated OR Deferred. I personally prefer to write SQL DSL in whatever language I am using whenever there is a join and explicitly add gather and add the posts. But I should probably get over that. Most of the time that is more cumbersome and having them eagerly there reliable is usually what I want anyways.