FireDAC.Phys.SQLite.TFDSQLiteCollation
Delphi
TFDSQLiteCollation = class (TFDSQLiteService)
C++
class PASCALIMPLEMENTATION TFDSQLiteCollation : public TFDSQLiteService
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | FireDAC.Phys.SQLite.pas FireDAC.Phys.SQLite.hpp |
FireDAC.Phys.SQLite | FireDAC.Phys.SQLite |
Description
The class implementing a custom SQLite collation.
Use the TFDSQLiteCollation to register a custom SQLite collation. A registered collation then may be used in any place in a SQL command where a collation may be specified.
For example:
SELECT * FROM "Employees" ORDER BY LastName COLLATE UTF16NoCase
Each collation must have a unique name specified by CollationName and one of the three kinds of collation specified as the additional properties:
- CollationKind = scCompareString. To set up its properties, use the LocaleName and Flags properties. Depending on the platform, the collation will use :
- Win32 / Win64 - API CompareStringW.
- OS X / iOS - API CFStringCompareWithOptionsAndLocale.
- Android - LibICU API u_strToUpper, ucol_strcoll.
- CollationKind = scCustomUTF8. To compare the application strings, the user should use the OnCompare event, which will receive strings in UTF8 encoding.
- CollationKind = scCustomUTF16. Similar to scCustomUTF8, but strings will be in UTF16 encoding.
After setting up the collation, it must be activated using the Active property. To use a collation in a SQLite connection, the application must activate the collation before opening a database connection.