<div dir="ltr">Hi Matthew!<br><br><div>Yes, I think it is possible to add such functionality to Pony ORM. This is not absolutely simple (because queries should be combined in some intelligent way), but it is doable in all supported SQL engines.<br>
<br>Could you describe your use-case in more detail, for what purpose you plan to use such query algebra?<br><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 28, 2014 at 6:46 PM, Matthew Bell <span dir="ltr"><<a href="mailto:matthewrobertbell@gmail.com" target="_blank">matthewrobertbell@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>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).<br>
<br>Example:<br><br></div>class Blah(db.Entity):<br></div>� a = Required(int)<br></div>� b = Required(int)<br><br></div>query_1 = Blah.select(lambda blah: blah.a > 5)<br>query_2 = Blah.select(lambda blah: blah.b < 10)<br>
<br></div>Operations could then be possible such as:<br><br></div>query_1 | query_2<br></div>query_1 & query_2<br></div>query_1 - query_2<br><br></div>Is this possible with all SQL engines? I guess a new query object would be returned, which can then be executed as normal.<span class="HOEnZb"><font color="#888888"><br clear="all">
<div><div><div><div><div><div><div><div><div><div><div><br>-- <br>Regards,<br><br>Matthew Bell<br>
</div></div></div></div></div></div></div></div></div></div></div></font></span></div>
<br>_______________________________________________<br>
ponyorm-list mailing list<br>
<a href="mailto:ponyorm-list@ponyorm.org">ponyorm-list@ponyorm.org</a><br>
<a href="/ponyorm-list" target="_blank">/ponyorm-list</a><br>
<br></blockquote></div><br></div>