Note that the availability of FTS is dependent on the underlying
sqlite
package used, as it is an extension that must first be enabled in the package.- Flutter SDK: Uses the sqlite_async package for migrations
- JavaScript Web SDK: Requires version 0.5.0 or greater (including wa-sqlite 0.2.0+)
- React Native SDK: Requires version 1.16.0 or greater (including @powersync/react-native-quick-sqlite 2.2.1+)
Example Implementations
FTS is implemented in the following demo apps: We explain these implementations in more detail below. Example code is shown mainly in Dart, but references to the React or React Native equivalents are included where relevant, so you should be able to cross-reference.Walkthrough: Full-text search in the To-Do List Demo App
Setup
FTS tables are created when instantiating the client-side PowerSync database (DB).lists
and todos
tables already created in this demo app. Don’t worry if you already have data in the tables, as it will be copied into the new FTS tables.
To simplify implementation these examples make use of SQLite migrations. The migrations are run in migrations/fts_setup.dart in the Flutter implementation. Here we use the sqlite_async Dart package to generate the migrations.
Note: The Web and React Native implementations do not use migrations. It creates the FTS tables separately, see for example utils/fts_setup.ts (Web) and library/fts/fts_setup.ts (React Native).
createFtsMigration
function is key and corresponds to the below (Dart example):

FTS tables and migrations

FTS triggers
FTS Search Delegate
To show off this new functionality, we have incorporated FTS into the search button at the top of the screen in the To-Do List demo app:
lists
or todos
that you have generated.

Example of searching