Generate DDL to create the full-text search index.
Name for the FTS index/virtual table.
Columns to index.
OptionalcontentSource table (for external-content FTS5).
Optionaltokenizer?: stringTokenizer config (e.g. 'porter ascii').
Generate an INSERT to sync external-content FTS after a row insert.
SQLite: INSERT INTO fts_table (rowid, col1, col2) VALUES (expr, ?, ?)
Postgres: UPDATE content_table SET _tsv = to_tsvector(...) WHERE ...
Generate a SELECT joining the FTS index to the content table. This handles the structural difference between FTS5 (separate virtual table joined via rowid) and Postgres (tsvector column on the content table itself).
The base table (e.g. 'memory_traces').
Alias for the content table (e.g. 't').
FROM/JOIN clause fragment.
Postgres full-text search using tsvector columns and GIN indexes.
Unlike FTS5 (separate virtual table), Postgres stores the tsvector as a column
_tsvon the content table itself. ThecreateIndex()call adds the column, creates the GIN index, and backfills existing rows.