#1 2014-02-14 10:20:27

O.Schwab
Member
From: Montpellier, FRANCE
Registered: 2013-03-29
Posts: 12

Case insensitive comparisons

Hello,

As far as I understand everything I read about mORMot and SQLite, mORMot extended the NOCASE collation by its own SYSTEMNOCASE collation, and is used as the default collation.
My problem is that I need to perform a case sensitive comparison so I tried the following :

type
  TSQLibelleDev = class(TSQLRecord)
  protected
    class procedure InternalRegisterCustomProperties(Props: TSQLRecordProperties); override;
  ....

class procedure TSQLLibelleDev.InternalRegisterCustomProperties(Props: TSQLRecordProperties);
begin
  Props.SetCustomCollationForAllRawUTF8('BINARY');
end;

Unfortunately, SetCustomCollationForAllRawUTF8 doesn't seem to exist any more.


How can I perform a case sensitive comparison ( equality comparison, not LIKE comparison)  ?

Ty

Last edited by O.Schwab (2014-02-14 10:21:57)

Offline

#2 2014-02-14 13:18:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Case insensitive comparisons

With a simple search, you can see that it has been moved to TSQLModel.SetCustomCollationForAllRawUTF8().

It does indeed make more sense to set it not at TSQLRecord level, but for the scope of a given data model.

Offline

#3 2014-02-14 13:57:19

O.Schwab
Member
From: Montpellier, FRANCE
Registered: 2013-03-29
Posts: 12

Re: Case insensitive comparisons

Dear Arnaud,


In the version i'm actually using in production (version 1.17), this function seems to be nowhere :

ML3XBGF.png?1

I'll try to plan integration of version 1.18 in my project ...

Last edited by O.Schwab (2014-02-14 14:37:26)

Offline

#4 2014-02-14 16:39:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Case insensitive comparisons

AFAIR this method has been introduced in 1.18.
See the detail in the revision history at the beginning of mORMot.pas.

There are a LOT of improvements and fixes in version 1.18, by the way.
smile

Offline

Board footer

Powered by FluxBB