Fork me on GitHub

Hello, again me hope you don't mind. Question regarding entities in general. I was looking for an answer here regarding updated-at , created-at attributes i'd like to have in my entities. and i found If i understood correctly time tracking would become available within next major version, this was 6 months ago so i am wondering if that's the case? Should i be adding new attributes to my entities or there is some XTDB mechanism that i am unaware of that i can utilize to get this information?


Hey 🙂 questions are always welcome! If you need to search for these times as part of your general querying, then yes you should be adding new (regular, duplicated) attributes to make them available for querying within Datalog. You could also create reified transaction entities and join against those for searching tx-times. If you only need to retrieve these times, then the solution in the gist I shared in that thread may be enough. If you need anything more advanced, like temporal joins or windowing, then you will still need to wait for the next major version - and in the meantime make do with pulling out all the necessary raw data for processing in normal Clojure. I can't share a firm roadmap just yet but I'd be very happy to chat about it if you're curious...


I'm using a standalone node while trying to bootstrap a project, but find the entries keep disappearing. Is that expected? I'm not restarting the repl or in any obvious way re-defing the db node.

Steven Deobald20:04:49

"standalone", as in, in-memory?

Steven Deobald20:04:24

That's peculiar. Is your code up somewhere we can glance at? I'm guessing this will be really easy for someone to diagnose, but it's hard to know based on that description.


It must be some side effect of either Liberator or vim-fireplace.


I'm just discovering that it happens every time I :RunTests


And defonce didn't fix it. Hrm.


so you're just doing something like (def my-node (xt/start-node {}))? with an empty opts map?


Yes, that's what I've been doing


The entries also disappear outside of using :RunTests


I just replaced that with a RocksDB setup so we'll see how that goes.

🤞 1

The data persisted through the night 😉 So that's a win! Having some other troubles with running tests that I'll try to work through today.


Excellent, I'm glad to hear you're over that initial hump (though I'm still curious as to what might have been happening!)

Steven Deobald16:04:40

I'm also very curious. That's peculiar behaviour. And probably something we want to document, assuming it's consistent with :RunTests.


It was definitely consistent with :RunTests. Should I have done anything special beyond (def node (xt/start-node {}))?


And I used lein ring server-headless to start the repl, if that makes any difference.

Steven Deobald16:04:20

Nothing special should be required... but the :reload on line 2541 of seems maybe suspicious? Sorry I'm not more help here... I've never once in my life looked at vimscript before. To diagnose from the outside, it might be interesting to see if running the tests from another test runner entirely still causes you trouble.