- assigned issue to
SqlSoup documentation seems incorrect for mysql joins
The SqlSoup documentation states:
""" If you’re unfortunate enough to be using MySQL with the default MyISAM storage engine, you’ll have to specify the join condition manually, since MyISAM does not store foreign keys. Here’s the same join again, with the join condition explicitly specified:
db.join(db.users, db.loans, db.users.name==db.loans.user_name, isouter=True) <class 'sqlalchemy.ext.sqlsoup.MappedJoin'> """
But, I found that I actually had to specify:
db.join(results, jobs, results.c.jobs_id==jobs.c.jobs_id) <class 'sqlalchemy.ext.sqlsoup.MappedJoin'>
When using the documented syntax I got:
db.join(results, jobs, results.jobs_id==jobs.jobs_id) ... AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object has an attribute '_sa_instance_state'
This is with SQLAlchemy 0.5.2. The exception source is line 136 of sqlalchemy.orm.attributes.
Mike
Comments (6)
-
repo owner -
- assigned issue to
-
repo owner -
repo owner - changed status to wontfix
Not sure above what
results
andjobs
are, this would suggest that they areTable
objects. In the referenced documentation,db.users
anddb.results
are mapped classes. -
repo owner err, that is
db.users
anddb.loans
. -
repo owner - removed milestone
Removing milestone: 0.5.xx (automated comment)
- Log in to comment