if Tables were created *without* an engine, and you then said ForeignKey('mytable.foo'), how would it locate 'mytable' ? a global dictionary ?
No, the engine would be assumed to be the global default ProxyEngine engine, unless otherwise specified. The idea being, many many classes of applications have just one database to talk to, and just one "schema" in your terms. If you don't pass an engine, use the global engine, otherwise use the specified engine. I think this would deal with your ForeignKey argument pretty easily as well.
what if your application then wanted to talk to three different databases that all had its own "mytable"?
Then, pass in an engine in the constructor for at least two of the "mytable" Table objects :)
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 really like the concept of grouping together sets of tables into a schema, as I really think that makes sense -- its how databases work at some level. I hadn't thought about it this way, as I was thinking of the engine purely as connection handling, not grouping tables together into a logical set.
That being said, I don't think that necessarily negates the utility of Aaron's idea of assuming a single engine (thus a "schema") unless explicitly passed an engine kwarg. In fact, I think its clear that its quite a compatible idea.
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.
Understandable. Both a "schema" and a "connection" will share the same objects anyway, so no need to complicate. I am not sure if the documentation for engines explains this synergy or not, but it probably should. I certainly can't think of a better name than "engine" off the top of my head, so I think just a good explanation in the documentation would be adequate.
I understand engines better now thanks to your explanation, but I still think Aaron's idea is a good one.
-- 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

