message: Add countEntries
diff: @@ -98,6 +98,22 @@ export class DbRoomStore {
  this.entriesMatrixIdCache = new TimedCache(ENTRY_CACHE_LIMETIME);
  }
  + /**
  + * Returns the number of bridged room pairs. Every connection between a
  + * Matrix room and a remote room counts as one pair.
  + * @returns {number} The amount of room pairs as an integer
  + */
  + public async countEntries() {
  + const row = (await this.db.Get("SELECT COUNT(*) FROM room_entries")) || {};
  +
  + if (typeof row.count !== "number") {
  + log.error("Failed to count room entries");
  + throw Error("Failed to count room entries");
  + }
  +
  + return row.count;
  + }
  +
  public async upsertEntry(entry: IRoomStoreEntry) {
  const promises: Promise<void>[] = [];
  