3 ms·
Too bad the idea of on-the-fly ORM never really caught on in the Python community (https://pypi.python.org/pypi/pybean/0.2.1 https://pypi.python.org/pypi/pybean
by gabordemooij 12y ago
Too bad the idea of on-the-fly ORM never really caught on in the Python community (https://pypi.python.org/pypi/pybean/0.2.1 https://pypi.python.org/pypi/pybean/0.2.1 not my project btw).
I believe this is a better way to approach the mismatch between the object model and the relational model.
- zzzeek 12y agosome people love this idea, and for many years we've had a product called SQLSoup (https://sqlsoup.readthedocs.org/en/latest/ https://sqlsoup.readthedocs.org/en/latest/) which does exactly this on top of the SQLAlchemy ORM, and the docs for pybean look quite similar. However I don't have the resources to maintain this very old project right now (it's only about 500 lines, anyone can pick up the source if they cared). A more SQLA-centric version of this idea is recently released as the automap extension (http://docs.sqlalchemy.org/en/latest/orm/extensions/automap.html http://docs.sqlalchemy.org/en/latest/orm/extensions/automap....) which includes the "map everything on the fly" step plus relationship support, and you then use traditional Query patterns with it. Reaction to it has been mixed, depending on where the user is coming from.
- Nullabillity 12y agoSlick (http://slick.typesafe.com/ http://slick.typesafe.com/) seems to support this as well in a type-safe manner, but personally I'm not too keen on having the compilation depend on having a stateful database available.