kayak / pypika

PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.
http://pypika.readthedocs.io/en/latest/
Apache License 2.0
2.54k stars 296 forks source link

Query() gets changed to ContainsCriterion() #436

Open Kulu-M opened 4 years ago

Kulu-M commented 4 years ago

After using .isin() or .notin() on a simple SELECT Query, the object gets changed to a ContainsCriterion object. Is this inteded behavior? If so, how do I add things to the query after that?

Example:

query = Query.from(...).select(...)

query = query.where(...).isin(...)

query = query.join(...)

After the second line I can't change the query anymore. The third line will fail with ContainsCriterion has no attribute 'join'.

Thanks for any input!

cpinamtz commented 4 years ago

Can you please provide the query you're trying to replicate with Pypika?