if Tables were created *without* an engine, and you then said
ForeignKey('mytable.foo'), how would it locate 'mytable' ? a global
dictionary ? what if your application then wanted to talk to three
different databases that all had its own "mytable"?
the engine passed to table serves as a base for the "schema" that the
Table belongs to. This "schema" doesnt have to be connected to any
database, either by using an arbitrary ansisql engine or the proxy
engine.
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.
you can now play with tables and columns at a different level, by
using TableClause and ColumnClause objects, which are not bound to
anything; but it hasnt become apparent to me if thats at all useful
at all since they cant have name-based foriegn keys in them (no "home
base" to find other tables).
On Mar 1, 2006, at 1:26 PM, Jonathan LaCour wrote:
Aaron Bickell wrote:
user_table = Table('user',Column(...), Column(...),...)
sqlalchemy.default_engine.connect('postgres://...')
sqlalchemy.default_engine.begin()
# ... do various things
sqlalchemy.default_engine.commit()
I love this idea, personally. But Aaron is a co-worker of mine, so
I am biased I suppose.
I always found it kind of strange to have to pass in an engine when
I am defining a table. At that point, I really have no idea what
engine I am going to be using, or the DB connect string. The
ProxyEngine helps this greatly, but it does seem kind of strange to
have to pass it into the constructor for every table, and store it
in my own global place.
In short, I am in full-support of this concept, at least in principle.
--
Jonathan LaCour
http://cleverdevil.org
-------------------------------------------------------
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
-------------------------------------------------------
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