little_pger.py (a thin layer a tad above SQL and psycopg2)
От | Christian Jauvin |
---|---|
Тема | little_pger.py (a thin layer a tad above SQL and psycopg2) |
Дата | |
Msg-id | CAJSE4Tr_=hgvyj6O5t-g68VgfOEzYBQPJEc=VtdzQ8mG0_qKig@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: little_pger.py (a thin layer a tad above SQL and psycopg2)
|
Список | psycopg |
Hi, A couple of years ago, when I first studied the possibility of using a Python ORM for a project, I rapidly got the impression that they were (1) too heavy and complicated and (2) abstracting away SQL in an "unhealthy" way. I think I was also influenced by this blog article: http://database-programmer.blogspot.ca/2008/06/why-i-do-not-use-orm.html Maybe that judgment was a bit quick, but as I always liked pure SQL anyway, I decided to stay happy with psycopg2, and I never looked back. However, as I was developing CRUD web apps, where you're basically exchanging JSON data between the UI and the database, I began hiding the manipulations required to compose my queries with simple functions, all operating on plain data structures, and using psycopg2: https://github.com/cjauvin/little_pger If someone has time and interest for it, I'd really appreciate some opinion about such an approach. Does it make sense, is it useful? Are there use cases for it, beside mine? As I've always considered the idea almost trivial, I spent some time searching for an equivalent implementation, but never really found one, to my surprise. I don't know about it much, but I got the impression that SQLAlchemy Core would be the closest (and quite more powerful of course), but I don't really know yet. Thanks for your time, Christian
В списке psycopg по дате отправления: