Is there something easier than ORM?

M.-A. Lemburg mal at egenix.com
Wed Feb 18 06:36:45 EST 2009


On 2009-02-17 13:27, 一首诗 wrote:
> 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?

Python has a DB-API standard for direct access to databases using
a very simple cursor-based approach:

    http://www.python.org/dev/peps/pep-0249/

All the DB-API compatible modules provide such an interface:

    http://wiki.python.org/moin/DatabaseInterfaces

> Or is there some tools that could generate code from database scheme
> as I want?

I am not aware of an automated tool for generating SQL queries
in form of Python functions, but it is certainly possible to write
one by tapping into the system tables of the database of your
choice.

Our database tools mxODBC and mxODBC Connect come with a set of
catalog methods that make such introspection very easy across
databases and platforms:

    http://www.egenix.com/products/python/mxODBC/
    http://www.egenix.com/products/python/mxODBCConnect/

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Feb 18 2009)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/



More information about the Python-list mailing list