Reactive Flows

Generated SELECT methods can observe table invalidations and re-run when related data changes. Generated INSERT, UPDATE, and DELETE methods notify watchers automatically.

late final StreamSubscription<List<TaskRow>> subscription;

subscription = db.task.selectAll().watch().listen((rows) {
  setState(() => tasks = rows);
});

If hand-written SQL changes the same database outside generated SQLiteNow methods, report the affected tables:

db.reportExternalTableChanges({'task'});

External change reporting is rare in normal app code. It is for direct SQL, imports, sync integrations, or other local writers that bypass generated SQLiteNow methods.