You are not logged in.
Pages: 1
mORMot.pas
function SQLFromWhere(const Where: RawUTF8): RawUTF8;
Could you add a check for LEFT, RIGHT, INNER, OUTER JOIN?
And could you exclude spaces before this and other keywords.
For example, ' where 1 = 1' - doesn't work correctly.
Offline
AFAIK you should not put the 'where' keyword in the Where parameter.
About '1 = 1', I do not understand your point. It would depend on the method. Have you code to reproduce it? Some methods expect a true field name to be supplied, e.g. fieldname=value, and would check for the fieldname.
For a JOIN, you would need to have a reference to two (or more) tables, which is not the context of SQLFromWhere(), which applies to a single table.
For JOIN, you should use http://synopse.info/files/html/Synopse% … l#TITL_129
But only default mode is LEFT JOIN, for the ORM.
For most complex queries, you may just run the plain SQL, without the ORM.
Take a look at TSQLRest.ExecuteList().
Anyway, I've updated SQLFromWhere() to identify LEFT, RIGHT, INNER, OUTER JOIN clauses.
See http://synopse.info/fossil/info/241c94dc8d
Offline
Thank you. it's enough
Offline
Pages: 1