zzzeek / test_sqlalchemy

0 stars 0 forks source link

In mssql, autoloading a table with FKs doesn't load the referenced table #979

Closed sqlalchemy-bot closed 16 years ago

sqlalchemy-bot commented 16 years ago

Issue created by Anonymous


When I reflect a table with FKs, it comes in OK, and the metadata seems to know about the FK, but eval'ing 'referenced_table' in meta.tables (as in the example) returns False.

Also, reflecting the referenced table without the autoload=True parameter doesn't work -- the table I get is empty (but it does come in OK if I use autoload).

I also tried using meta.table_iterator, and got a message like "Could not find table xxx with which to generate a foreign key". The table its asking for is indeed referenced, and if I autoload it (and all the other referenced tables), the iterator works fine.

This seems to be mssql-specific. I've tried it with MySql, and it works OK.

sqlalchemy-bot commented 16 years ago

Anonymous wrote:


(original author: ram) Posted a trial patch to the -user list, let's see how that shakes out.

sqlalchemy-bot commented 16 years ago

Anonymous wrote:


(original author: ram) Seems to work, committed in c096aeefe04ff77dbbef084923c75bf928620a27.

sqlalchemy-bot commented 16 years ago

Changes by Anonymous: set state to "resolved"