Closed dotWee closed 9 years ago
To me this appears a bit too usage-specific for a general API. For all intents and purposes, this function really only builds a Criterion; I'm happy to leave the details of that to the developer, particularly for something like filtering, which seems straightforward but can actually be rather complicated.
Alright, was just a thought. Issue closed.
@dotWee I may be reading a bit much into your example, but if you are trying to implement text search across multiple columns that may have lots of content (e.g. finding documents with a specific word in the title, body, etc.), maybe FTS with a virtual table is something to consider for your use case? Android SQLite binaries include the FTS4 extension and we support this in SquiDB using the virtualModule
argument of the @TableModelSpec
annotation -- just be aware this creates a virtual table, not a regular one, so its behavior is governed by the module and not the typical SQLite rules (for example, with FTS4 all columns are text columns, column constraints do not work, etc).
Haven't heard about SQLite's virtual table modules until now. It seems a bit overkill since I'm only searching through a small number of columns with the average content-length of 100 chars.
Thanks for recommendation though!
I'm not very active in the SQL scene and also don't know much about its principles (maybe there already exists something like that?), but I find myself writing methods similar to the following: