API Suggestions :D #294
Replies: 2 comments 1 reply
-
Hi there, welcome! Thank you for your feedback, we need you. And thank you for actually taking the time to read our docs ) (And thank you for actually make use of the discussions tab )) Yes, we are definitely heavily inspired by Laravel and it's our goal to make people coming from a dynamic language feel right at home.
Well, SeaORM is an ORM, not a web framework. Rust is multi-modal, meaning there could be multiple scenario (web, embedded, desktop). We do bundle Rocket framework integration into our codebase, so at least if you are using Rocket, you don't have to bother. https://github.com/SeaQL/sea-orm/blob/master/examples/rocket_example/src/main.rs (You made a good point, I should add one more paragraph to the docs)
It's a forward looking strategy for now. It's far easier to have long function names and then introduce shorter ones and deprecate the longer ones some point in the future, than to having a too general function name and having to deal with ambiguous names later. When the feature set is more or less stable, I'd be happy to introduce shorthands for some of them.
Sorry on this one, I don't really understand, do you mean the |
Beta Was this translation helpful? Give feedback.
-
Very thorough response thank you!
|
Beta Was this translation helpful? Give feedback.
-
Thank you for this ORM! It's hard to imagine a better developer API for this ORM. But here are a few thoughts.
Disclaimer: I come from Laravel, which uses EloquentORM. Most of these suggestions come from what I see working very well over there.
Potential improvements:
find_also_related(Fruit)
andfind_with_related(Fruit)
is a little clunky. Consider:with(Fruit)
for eager loadingAnother thought:
From the documentation:
Finally, there is no singleton (global context) in SeaORM.
I understand why. All good. However, consider the value of making developers worry about passing the connections around their applications. Serious question, is there any value? It sure is a pain in the butt. If there is no value, it is more tempting to try and work through this problem.I know the singleton pattern has its problems too, especially for Rust. And in a multithreaded webserver context, this is not going to be an easy feature to add. But thought I would start that dialogue and see what we can do :D
Beta Was this translation helpful? Give feedback.
All reactions