ORM is lazy? #202
Replies: 1 comment 1 reply
-
Hello! These are all valid concerns that you have. Partially because of how use cot::db::query;
let link = query!(Link, $slug == LimitedString::new("cot").unwrap())
.get(request.db())
.await?; (example taken from the guide) Hopefully, this will make people think twice before executing anything—basically the idea is that if you take this On the side, some places are obviously non-optimal because of "laziness". For example, there is no way to prefetch So yeah, the ORM is not lazy by default, we should need no switch between lazy and non-lazy versions, and the admin panel should not rely on laziness. Let me know if there's anything more on your mind, as this is an important problem and it would be nice to get it right from the beginning. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all! I just came across this project and I think it looks very cool
One thing tho - is the ORM going to be lazy out of the box? Because as many of us know, the bottle neck for Django isn't python when the project gets bigger, it's that dammed ORM and it's naturally lazy loaded nature. People start using it it like a state machine rather than a database and the whole thing slows down to a crawl. No amount of rust is going to save you from that.
Will the ORM be lazy by default?
Can you turn off lazy loading easily when the project is created, or after the fact?
Will the admin panel rely on laziness?
Thanks a bunch! And I am excited to try this out
Beta Was this translation helpful? Give feedback.
All reactions