little_pger.py (a thin layer a tad above SQL and psycopg2)

From: Christian Jauvin <cjauvin(at)gmail(dot)com>
To: psycopg(at)postgresql(dot)org
Subject: little_pger.py (a thin layer a tad above SQL and psycopg2)
Date: 2012-12-18 17:27:20
Message-ID: CAJSE4Tr_=hgvyj6O5t-g68VgfOEzYBQPJEc=VtdzQ8mG0_qKig@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse psycopg by date

  From Date Subject
Next Message A.M. 2012-12-19 16:29:27 Re: little_pger.py (a thin layer a tad above SQL and psycopg2)
Previous Message Daniele Varrazzo 2012-12-13 19:57:52 Re: New 9.2 features into the devel branch?