Ian Bicking <[EMAIL PROTECTED]> writes:
Re: "database.py -> uses a CP filter to handle transactions which could be
implemented as middleware or in the base controller itself. Using SQLAlchemy
by default but supportin SQLObject too (maybe they can be splitted into two
different components altogether which share the same interface?)"
I would like to see this happen; an ORM is a dumb place to manage connections,
since there's little high-level about connections. I outlined some ideas here
recently: http://mail.python.org/pipermail/db-sig/2006-November/004855.html
Also sqlapi (itself dormant) is an attempt to extract some of this:
http://sqlobject.org/sqlapi/
Additionally some kind of transaction container is required; Zope's seems fine
and simple, except that it needs to be properly extracted from Zope. I expect
that higher-level database tools will probably add themselves to the
transactional container (in addition to the database connections they manage),
so that they can effectively monitor the state of the transaction that way.
One of the most problematic things I see with ORMs and web apps in general is
the auth (both auths) part with the database.
Ideally one would be able to open a connection (to reuse a pool of
connections) and immediately change to another user (usually one DB user per
app user, but it isn't necessarily true) so that there is a stronger
protective layer on the database. Today we simply connect to the DB and have
to use specific SQL commands for that -- when people know that they can do
that... -- or we have to have some inefficient connection mechanism.
For GUI apps this isn't a problem since one usually opens one or two
connections to the database per running copy and usually authenticates with
the user's own DB user. There's no pool since there's only one person on each
host using the application...
I know that with filters and decorators and middleware this is possible and
might be really "easy" to do, but I really believe that there should be a
common interface for doing that. If the database doesn't support this kind of
operation then this become a no-op and the command is silently ignored. Of
course there's a tradeoff between performance and security here (as everywhere
else).
Maybe this is off-topic, but since you mentioned dumb ORMs, I remembered
that. ;-)
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---