On 7 April 2016 at 20:20, Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote:
> On 2016-04-07 13:00, Luiz Americo Pereira Camara wrote: > > If there's not in pascal, someone knows such templating in another > > languages? The hard part is getting a flexible and functional syntax > > I have written such code for the tiOPF project, but it should be quick > to detach any tiOPF dependencies. The code is well unit tested too (see > the tiCriteria_TST.pas unit). The unit test code is also good for usage > examples. > > It can't handle all complex cases, but is fairly good. It also has an > option to inject any SQL as-is, in case you need a complex WHERE clause. > > http://geldenhuys.co.uk/tiopf/ticriteria/index.html > > In summary, you use the TtiCriteria class to add your desired criteria, > then call tiCriteriaAsSQL(...) which will generate the SQL WHERE clause > string for you. Interesting. I've been meaning to look into tiOPF for a while. Part of that massive TODO list :-) This moves it up that list... Mike
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal