Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 52 forks source link

FTS4 Full Text Search for sqflite (sqlite) #116

Open vectorlit opened 5 years ago

vectorlit commented 5 years ago

Both Android and iOS have native support for the FTS4 virtual table module extensions. Currently there is no way in jaguar to enable these.

Documentation on the feature is here for FTS4: https://sqlite.org/fts3.html

In other popular abstracted mobile ORMs, such as Entity Framework for mono/xamarin, this support is generally accompanied with code annotation support for COLLATE NOCASE. Without caseless collation, the FTS MATCH feature is generally not useful.

_Documentation on collation methods are here, but specifically pertinent to this request is https://sqlite.org/datatype3.html#collation_sequence_examples_

My suggestion is for adding the following for sqflite ORM only:

  1. Add support for table creation statements to allow for the "VIRTUAL [...] USING FTS4" flags
  2. Add support for comparison operator 'MATCH' when FTS4 is enabled on a table.
  3. Annotations support for fields to have COLLATE NOCASE option