crsql_tracked_peers is a table that can be used for tracking what updates have been received from peers or sent to peers.
This table is useful for authors of custom network / syncing layers.
CREATE TABLE crsql_tracked_peers( [site_id] BLOB NOT NULL, [version] INTEGER NOT NULL, [tag] INTEGER, [event] INTEGER, PRIMARY KEY ([site_id], [tag], [event]) ) STRICT;
- site_id - the unique id of the peer
- version - falls into two categories:
- For receive events: The clock value we last received from that peer
- For send events: The clock value we last sent that peer. I.e., For sends, this is our db's clock not the peer's.
- tag - used to differentiate sync sets. Tag is set to
0for whole database syncs. Inserts into
crsql_changeswhere tag is set to
-1will not create tracking events. If you're only syncing subsets of the databse then this tag represents the subset you're syncing, such as an id of a "root node" of some sub-graph. Coming soon -- see [[docs/replicated-subgraphs]]
- event - 0 for receive events, 1 for send events. Values below 1000 are reserved for
- All other values are open for use by clients.
- [2-1000] - reserved
- All other values are open for use by clients. Prefer
eventif you need to track many version for a given peer.