Use event time instead of transaction time in Datomic?

筅森魡賤 提交于 2019-12-06 02:14:12

In general, Datomic's transaction time (t) is intended to record when the system found out about a fact, not the domain time of the fact.

If you need to handle domain time (i.e. the time something occurred in the 'real world', or event time in your example), I'd strongly recommend modeling the domain time explicitly with an attribute (you can use an attribute of type :db.type/instant). This would allow you to set dates without any restriction as well as query both domain time and system time separately for questions like "when did X happen AND when did my database find out about X happening?".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!