y-crdt / ypy-websocket

WebSocket Connector for Ypy
https://davidbrochart.github.io/ypy-websocket
MIT License
42 stars 21 forks source link

Add datetime column to sqlite YStore #44

Closed ellisonbg closed 1 year ago

ellisonbg commented 1 year ago

We are finding situations where it would be useful to order updates by date/time. One example is to clean out or combine updates of older documents. The idea is that a YStore subclass could order by room id and sort by date/time and pick the last entry to find the last time the document was edited. If that is longer than a certain amount of time (say a week) we could delete the history of that document or collapse it into a single update.

The proposal is to add a new date/time column to the database and to compute the date/time in the write method.