|
|
|
|
|
by theptip
1312 days ago
|
|
It’s really not that close IMO. Diesel is more analogous to SQLAlchemy. It doesn’t have the nice distinguishing features of the Django ORM like model-based schema generation and auto-generated migrations; it’s on you to ensure your struct lines up with the DB table, and you have to write the SQL for up/down migrations by hand. The API layer options I have seen are more like Flask rather than generating full APIs from the model schema. I’d love for this to be the case but Rust is not close to having a Django yet. Part of the problem is that structs are very inflexible; there is no equivalent of the metaclass manipulation that Django does. You could perhaps build something equivalent with macros? But there is lots of syntactic sugar in Python like descriptors that let you generate really clean class-level APIs. |
|