Fork me on GitHub
#datomic
<
2024-05-23
>
jasonjckn22:05:25

can you specify tx-fns and d/implicit-part in EDN? how ? (that seems to be the two things that have me store schema in CLJ)

cch122:05:06

If you are talking about Datomic Cloud, no you cannot "specify" tx-fns in EDN (but you can, of course, invoke them) and no, you cannot specify partitions in EDN (because that capability does not even exist in Datomic Cloud). My understanding of on-prem is that tx-fns can optionally be expressed as pure data (and thus in EDN) and transacted into the database. They can also, as in Datomic Cloud, be configured and loaded from the classpath. I'm not sure about partition control ... and currently https://blog.datomic.com/2023/04/implicit-partitions.html. (@U1QJACBUM)

favila23:05:46

You could always make your own tagged literal and tagged reader

jasonjckn23:05:06

for both tx fn and implicit , ya thats a possibility

favila23:05:33

I think db/id tag can take implicit partition but has to have it as an entity not a part id, which leaks the abstraction a bit and so isn’t ideal

1
favila23:05:16

There is a reader for tx fns stored in fn objects

favila23:05:22

It’s db/fn

1
favila23:05:07

For classpath fns, just use the symbol, which is what it will be when you read with an edn reader