Deviation from object-relational mapping (pySQLFace)

sulyokpeti at gmail.com sulyokpeti at gmail.com
Wed Oct 15 02:27:37 EDT 2008


On okt. 14, 10:09, Bruno Desthuilliers <bruno.
42.desthuilli... at websiteburo.invalid> wrote:
> sulyokp... at gmail.com a écrit :
> (snip)
>
> > It is not convincing to look at an XML file alone. Let me give you an
> > example. Glade is a GTK+ application for creating GTK+ GUI. It
> > generates an XML file, that can be loaded in every programming
> > language that has libglade binding.
> > Similarly, there could be a
> > database design tool to create a database, and save SQL/DML
> > expressions into an XML config file.
>
> Why so ? What's wrong with a plain SQL file ? We already have a language
> for RDBMS schema description, and the schema description is itself
> stored in the RDBMS catalog so the SQL description can be regenerated
> from the RDBMS. I just don't see the point of storing all this in XML.
>
> > Then you create the RDB command
> > objects by loading the XML in your favourite language.
> > I think programming languages are intended for describing neither relational
> > databases nor GUIs.
>
> SQLAlchemy is an interesting attempt at integrating the relational model
> in a programming language.
>
> Ok, I don't mean neither of us is necessarily right and the other wrong
> - different POV, mostly, so I guess we can at least agree to disagree !-)

Plain SQL does not have a structure to easily handle metadata. XML has
several parsers, transformators like xmlto.
I am not going to reimplement relational stuff in XML or any
programming language. In my approach relational model is described in
SQL, processing is in a programming language, and XML is used for
interchange data. That data is actually SQL, and metadata to create
documentation.

I have looked into SQLAlchemy. I have seen this:
  users_table = Table('users', metadata, Column('id', Integer,
primary_key=True), Column('name', String), ...
  session.query(User,
Address).filter(User.id==Address.user_id).filter(Address.email_address=='jack at google.com').all()
  users_table = Table('users', metadata, Column('id', Integer,
primary_key=True), Column('name', String), ...
...and I do not like it.
My favourite programming language is python because of its simple and
practical syntax. SQLAlchemy is something different, something like
what I do in full time, and something I am fed up with.



More information about the Python-list mailing list