On 7/24/06, Jamie Wilkinson <[EMAIL PROTECTED]> wrote:
This one time, at band camp, Jonathan Ellis wrote:
>Looks like sqlite is allergic to the sql generated; works fine in postgres
>
>[for test/orm/mapper.py again]
>   def testjoin3tables(self):
>       class Joined(object):
>           pass
>       j = join(users, join(orders, orderitems), isouter=True)
>       m = mapper(Joined, j, allow_null_pks=True)
>       q = create_session().query(m)
>       q.select()

I have a 3 way join in a mapper that looks like this:

mapper(Registration, join(account, person).join(registration),
       properties = dict(account_id = [account.c.id, person.c.account_id ,
registration.c.account_id],
                         submissions = relation(Submission, lazy=True),
                         _url_hash = registration.c.url_hash,
                         )
       )

so you could change your join to something like:

j = join(orders, orderitems).join(users)

Well, I really think a valid join construct should yield valid SQL, so even if there were a way to get an outer join out of your workaround (I don't think there is), I think it should still be fixed either in sqlite or SA.  (I don't think you're arguing that it shouldn't be, but just for completeness...)

though, perhaps it's the lack of primary keys that is doing you in?

The tables (from test/tables.py) have PKs defined.  So do the tables in the example I posted to the sqlite list.

--
Jonathan Ellis
http://spyced.blogspot.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to