Some drivers can attach other open databases and reference them by alias
(i.e.: first you attach('foo.db') then you can write SQL queries like
select * from foo.bars. We keep track of attached databases and their
aliases, so we can map the table namespaces in SQL queries to their real
database names and thus emit and handle notifications to and from them.
Notification for network connectivity state changes.
A connectivity change is automatically triggered in consequence of internal client events.
'connected': connection to Electric established
'disconnected': Electric is unreachable, or network is unavailable.
A reason for the disconnection can be provided.
The data change notification workflow starts by the electric database
clients (or the user manually) calling potentiallyChanged whenever
a write or transaction has been issued that may have changed the
contents of either the primary or any of the attached databases.
Notification for shape subscription sync status changes.
Every notification will include a key that uniquely identifies the
shape for which the sync status changed, as well as the new sync status.
Reactive hooks then subscribe to "data has actually changed" notifications,
using the info to trigger re-queries, if the changes affect databases and
tables that their queries depend on. This then trigger re-rendering iff
the query results are actually affected by the data changes.
Satellite processes subscribe to these "data has potentially changed"
notifications. When they get one, they check the _oplog table in the
database for actual changes persisted by the triggers.