Is there something easier than ORM?
n.kottiyath at gmail.com
Tue Feb 17 07:40:33 EST 2009
> Hi all,
> Recently I am studying some python ORM libraries, such as sqlalchemy.
> These are very powerful technologies to handle database. But I think
> my project are not complicated to enough to benefit from a complete
> ORM system.
> What I really want, is some easy ways to load data from database, and
> change rows of data to list of named tuple, then I could send these
> data to my client application.
> I don't think I want these subtle behavior such as lazy load, auto
> update, ect. in ORM.
> So is there some libraries like that?
> Or is there some tools that could generate code from database scheme
> as I want?
If ORM is not used, you might have to contend with different tools for
different databases - and will have to write SQL commands.
Luckily everything follows DB-API2 properly. http://www.python.org/dev/peps/pep-0249/.
So you mostly dont have to change the commands to access DB.
For the different tools, this http://wiki.python.org/moin/DatabaseInterfaces
might be a good starting point.
For example - psycopg2 for postgresql is almost the default etc.
More information about the Python-list