watch method
Returns the Stream of real-time changes happening with the Credentials.
Implementation
Stream<List<MapChangeNotification<UserId, Credentials?>>> watch() {
return stream((db) {
final stmt = db.select(db.tokens);
return stmt
.watch()
.map((rows) => rows.map(_CredentialsDb.fromDb).toList())
.map((i) => {for (var e in i) e.userId: e})
.changes();
});
}