[fpc-pascal] Create dynamic SQL according to available params

Michael Thompson mike.cornflake at gmail.com
Thu Apr 7 14:47:25 CEST 2016


On 7 April 2016 at 20:20, Graeme Geldenhuys <mailinglists at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160407/95cf5627/attachment.html>


More information about the fpc-pascal mailing list