[SQLite] Add target_message generated column and index
Summary:
Generated colums in SQLite are described this way in the docs:
Generated columns (also sometimes called "computed columns") are columns of a table whose values are a function of other columns in the same row. Generated columns can be read, but their values can not be directly written. The only way to change the value of a generated column is to modify the values of the other columns used to calculate the generated column.
I found them from this blog post, which explains how to use a generated column and index to efficiently query on the contents of a JSON column in SQLite. I found that blog post from this Reddit comment.
Test Plan:
- I confirmed I could compile and run this on both iOS and web
- I checked the EXPLAIN QUERY PLAN for the query I use this index for (in a later diff) and it showed the index being used:
Reviewers: kamil, tomek, marcin
Reviewed By: tomek
Differential Revision: https://phab.comm.dev/D12759