On 01.03.2006., at 19:46, Michael Bayer wrote:
I did have some designs to change the name of "engine" to "schema"
and possibly adding an explicit "Schema" object, and in the very
beginning I sort of had it that way, so that it makes itself clear
as more of a "logical" database rather than "a connection to *this*
database". but it seemed to complicate things for no good reason.
So we can look into doing some name games like that, the
ProxyEngine would essentially become the base of the "Schema" object.
After some recent refactoring the oid_column_name method is called
when preparing join objects (implicitly with references, inherits etc).
The ProxyEngine.oid_column_name tries to get a real engine and raises
an exception if there was no connection.
(I posted a ticket but it disappeared, perhaps I've done something
wrong)
Maybe separating the thing in three distinct layers: schema ->
databaseEngine -> engine (or better names).
For example the databaseEngine knows the type of the database
(postgres, oracle etc) and may handle database specific issues like
oid_column_name that are needed before of actual queries. While the
"connection" is the actual connection of a table. That way the proxy
will instanced specific to the engine, having the possibility to
correctly obtain informations like oid_column_name.
Creating an engine a databaseEngine and a schema will be created. If
someone wants to define tables only with a databaseEngine will use:
engine = ProxyEngine(create_database_engine("postgres")) # or
something like that
or a more general proxy is needed
engine = ProxyEngine(oid_column_name=None)
or using a custom subclass
class PG_Sqlite_ProxyEngine(ProxyEngine):
def oid_column_name(self):
return "oid"
If the oid_column_name problem is an isolated case and there are/will
no other need for "offline" knowledge of db specific issues then
maybe it would be easier to fix it in some other way.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users