arso-project / sonar

A p2p content database and search engine
https://sonar.arso.xyz/
GNU General Public License v3.0
121 stars 6 forks source link

Rethink `get` and RecordCache in client #58

Open Frando opened 4 years ago

Frando commented 4 years ago

Currently, collection.get(req) in the client actually does a collection.query('records', req), so req can be a either { schema, id } or { key, seq }. Likely we want to have two seperate methods for this, because for key, seq (= ref soon?) we can easily check if the record is already loaded. For { schema, id } we might want to do the query always at the moment because new updates could have happened.