dhumphreys / cfrel

ColdFusion Relational Algebra Framework
16 stars 5 forks source link

Use another relation in where clause #5

Open liferealized opened 13 years ago

liferealized commented 13 years ago

I was trying to a sub select in a where clause but it does't look like cfrel likes this. Something similar to the following:

loc.whereRelation = model("somemodel").select("id").where("year = ?", [2009]);

loc.relation = model("someOtherModel").where("id NOT IN (?)", [loc.whereRelation]);

Hope this makes sense.

James

dhumphreys commented 13 years ago

Relations cannot be passed into parameters, since those values are directly plugged into cfqueryparam tags. However, I see the need for sub-queries within WHERE and SELECT clauses. I plan on expanding the parser to accept full SQL SELECT statements. Maybe this is a good time to do that?

dhumphreys commented 12 years ago

With 77bf9190c0, this should now be very easy to implement. Feature should be coming soon.