<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 7 April 2016 at 20:20, Graeme Geldenhuys <span dir="ltr"><<a href="mailto:mailinglists@geldenhuys.co.uk" target="_blank">mailinglists@geldenhuys.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2016-04-07 13:00, Luiz Americo Pereira Camara wrote:<br>
> If there's not in pascal, someone knows such templating in another<br>
> languages? The hard part is getting a flexible and functional syntax<br>
<br>
</span>I have written such code for the tiOPF project, but it should be quick<br>
to detach any tiOPF dependencies. The code is well unit tested too (see<br>
the tiCriteria_TST.pas unit). The unit test code is also good for usage<br>
examples.<br>
<br>
It can't handle all complex cases, but is fairly good. It also has an<br>
option to inject any SQL as-is, in case you need a complex WHERE clause.<br>
<br>
<a href="http://geldenhuys.co.uk/tiopf/ticriteria/index.html" rel="noreferrer" target="_blank">http://geldenhuys.co.uk/tiopf/ticriteria/index.html</a><br>
<br>
In summary, you use the TtiCriteria class to add your desired criteria,<br>
then call tiCriteriaAsSQL(...) which will generate the SQL WHERE clause<br>
string for you.</blockquote><div><br></div><div>Interesting. I've been meaning to look into tiOPF for a while. Part of that massive TODO list :-) This moves it up that list...</div><div><br></div><div>Mike</div></div></div></div>