5 ms·
I've been using plain sql, materialized views with postgrest for network endpoints. Therefore I don't need to maintain a backend. Is there any compelling reaso
by jackhalford 6y ago
I've been using plain sql, materialized views with postgrest for network endpoints. Therefore I don't need to maintain a backend.
Is there any compelling reason to try out an ORM?
- beckingz 6y agoSanitizing SQL injection?
- jackhalford 6y agoAll requests are going through postgrest's http layer [1]. [1] https://postgrest.org/en/v7.0.0/ https://postgrest.org/en/v7.0.0/
- inshadows 6y agoSQL injection where exactly? db.execute('select * from t where name = ?', ['Joe'])
- remram 6y agoIf you're doing fine without an ORM, don't bring one in. ORMs bring some user-friendliness and other niceties, but might drive you crazy by their strictness (objects lifetimes are bound to a session, it is harder to fetch/update parts of an object/relation, async is much more difficult because of lifetimes again, still need to take a look at generated queries to spot performance issues, ...). I am myself in the process of moving from the ORM to the core, because while I need the multi-backend support (including migrations), the ORM is proving too tricky for an app that's growing beyond simple CRUD.
- zerkten 6y agoI think you should try out the ORM outside the context of your application to get some familiarity. I don't think you should foist it on your existing app for no reason. Learning SQLAlchemy is a solid investment if you are working with Python and are going to be working with relational databases.