[PonyORM-list] Treating Pony Queries as "sets"

Matthew Bell matthewrobertbell at gmail.com
Tue Jan 28 14:46:06 UTC 2014


Hello,

I think that a useful feature would be treating pony queries as sets, which
can have set operations applied to them (since they are lazy).

Example:

class Blah(db.Entity):
  a = Required(int)
  b = Required(int)

query_1 = Blah.select(lambda blah: blah.a > 5)
query_2 = Blah.select(lambda blah: blah.b < 10)

Operations could then be possible such as:

query_1 | query_2
query_1 & query_2
query_1 - query_2

Is this possible with all SQL engines? I guess a new query object would be
returned, which can then be executed as normal.

-- 
Regards,

Matthew Bell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20140128/9ab8a083/attachment.html>


More information about the ponyorm-list mailing list