As a noob, ident
had my head spinning because everywhere I looked in Datomic I saw IDs. And dto is similar to allegrograph which I grok OK so it is not even alien technology. I guess idents
are closest to enum
in programmerspeak; they let us give a number a mnemonic (another term I would consider, along with alias). But wait, we are in the Land of Hickey, what does the dictionary say?
"name noun 1. a word by which a thing is known, addressed, or referred to."
Lovely. Btw, I do not like identifier because the entity-id is an identifier, and the real one needing no translation.
Fun stuff. 🙂
Yep. it takes time to learn the language 🙂.
I would be very surprised if it did 🙂 that said, it probably keeps a cache of compiled Datalog queries somewhere in the JVM.
Datomic has a philosophy of "I'm not slowing down because you're watching me", it seems to me that logging every query would go against that philosophy, especially given the aim that most queries be fast walks through in-memory data structures.
seems reasonable. Having that log isn't a goal of mine, if it existed it might be useful though. I'm considering how to extend the datalog language so it could be used across multiple databases. I have no real plans on doing this, just a thought experiment.
It can already do this?
Not sure if you are thinking exactly of this, but you can already supply multiple data sources, :in $ds1 $ds2
then reference in pattern clauses by [$ds1 e-match a-match ...]
or in rules by ($ds1 rulename ...)
Not having to mention the default $ name most of the time is syntax sugar
Idents have enough unique properties viz entity ids that it’s worth giving them another name imo. Entity id values are not user-controllable, are not a public contract, and should not be stored durably for long periods outside the system. Idents are all of these, and are also reassignable and guaranteed unique. You can maybe think of them as a special case of lookup ref where the :db/ident attr is implied, although historically lookup refs came later
This May be helpful as a primer on the kinds of “identifying” datomic has: https://docs.datomic.com/on-prem/identity.html
An impl note: at least on on-prem there is a full in-memory map of idents to eids and vice versa, so they are faster forms of reference than normal unique attributes and that is also why you shouldn’t have very large numbers of them
Idents are also valid even after retracted. This is so you can rename an attribute without breaking code—the old name will still work
Thx! I had indeed seen all that. I had not picked up, tho, that idents would work if stored outside the system even when entity-ids had changed. Interesting. But in that same section we see the sentence that actually, I recall, made me stop reading and look for a different tutorial:
When an entity has an ident, you can use that ident in place of the numeric identifier, e.g.
Thy syllables "id" and "ent" are doing the flight of the bumblebees in there. 🐝
The sentence before it was better. A little. The first half was fine. then it got weird.
Idents associate a programmatic name (a keyword) with an entity id, by setting a value for the :db/ident attribute
That's great like NYC street signs are great if we already know where we are going.
But yeah, "name" by itself would have its own challenges. I will close by noting that, if a db/ident is a name for an entity, then per Gertrude Stein:
The :db/ident of :db/ident is :db/ident.
I'd give that a 10.There is a really good video on this by folks at nubank. I believe it’s called 4 super powers of Datomic, where they talk about querying across multiple database. Highly recommended
Who do I get a older version of datomic dev-tools
???
My project uses com.datomic/dev-local {:mvn/version "0.9.184"}
and I can't find how to download it.
@stuarthalloway bit off but which maven repository do you use/recommend for small corps//personal experimentation?
I tend to use an S3 bucket -- a maven repo is just a convention about files.
I will look into that -- in the meantime, can you just update the dep to latest. They are all compatible.