Have you tried Diesel?
If you want to see all the warts, https://github.com/rust-lang/crates.io/blob/06bbe1fd16559b874bbb848f5713d13d445fbda0/src/controllers/krate/search.rs#L35-L232 … is one of the worst case scenarios (execute completely different queries based on a param in the URL), and one of the gnarliest examples out there.
-
-
https://github.com/rust-lang/crates.io/blob/06bbe1fd16559b874bbb848f5713d13d445fbda0/src/controllers/krate/metadata.rs#L42-L77 … is probably one of the nicer semi-complex cases (maybe not putting it in its best light, but I remember the code I hate more than the code I'm proud of)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Actually https://github.com/rust-lang/crates.io/blob/06bbe1fd16559b874bbb848f5713d13d445fbda0/src/models/krate.rs#L511-L515 …, which executes https://github.com/rust-lang/crates.io/blob/06bbe1fd16559b874bbb848f5713d13d445fbda0/src/models/krate_reverse_dependencies.sql … is another that I think is good to show off. Even if Diesel could represent that query today (it can't), sometimes writing raw SQL is just clearer. We have really good support for that as well.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.