In fact, what I am looking for, seems to be similar to TxQuery component that exists for Delphi. It is commercial though.
A component that would provide SQL querying capabilities for different datasets, such as Memds, Dbf, Sdf etc.
It seems to me that starting point could be JanSQL engine. But it deals with SQL strings, string lists, not TDataset descendants. Also, it is typeless, everything treating as Variant (performance issue?).
The good thing is that it has SQL Tokenizer and complete SQL engine.
So, either rewrite jansql completely, or extend it to transform resultset to TDataset? If the letter one, tranformation should be done twice- first for input datasets, then for resultset.
The component itself could be Memds descendant?
Your opinions?