datomic

Aldo Solorzano 2025-05-07T11:27:08.857439Z

Hi Folks! We have some exciting news datomic we are releasing a new tutorial on how to make "TODO List App" which will be structured in different parts covering specific topics about Datomic. You can go over https://docs.datomic.com/resources/learn-by-example.html section and take a look at it. Stay tuned for the the next part in the series.

👍 5
💯 2
👏 1
❤️ 4
4
🙌 8
vc 2025-05-08T14:19:02.287889Z

love it. may i know any eta you have on [soon] items?

Aldo Solorzano 2025-05-08T16:12:29.169039Z

Hey, the goal was to get this project started and we are actively working on the next parts of the tutorial with no defined time table. We will definitely incorporate feedback. Thank you!

👍 1
tatut 2025-05-07T12:12:12.136829Z

nice, but one question while reading, doesn't the :db/retract example retract just the single :item/text attribute? leaving the entity as an orphan. Haven't used datomic in a while, and I would have expected to see :db/retractEntity to remove all attrs and refs to it

Aldo Solorzano 2025-05-07T12:22:03.272919Z

That is correct, db/retractEntity is to remove all the datoms of the entity. In that example is to show how retract works in general, db/retractEntity will be use later.

tatut 2025-05-07T12:25:11.398159Z

also

(d/transact conn [{:db/id [:list/name "life"] :list/items [{:db/id "new-item" :item/text "todo 1" :item/status :item.status/todo}]}])
should work as well? so you don't need to d/entid as you can use the lookup ref and you can use a string tempid

tatut 2025-05-07T12:25:22.168669Z

but it makes sense if you are starting from basics, to introduce the api stuff

Aldo Solorzano 2025-05-07T17:51:06.279659Z

Yes, it's nice to see that the tutorial is provoking to think on alternatives ways to achieve the same thing. What we decided to put there is what we think it's a good path to navigate the learning curve of Datomic. What you suggested also works well, the difference here is that instead of resolving the lookup-ref to get the eid in the transactor, you do it in the peer. In some cases this can have some performance benefits for the tempid, yes you can use a string, although it's good practice to have a programatic way to generate those instead of hardcoded. i.e. if you transact many item in the the same transaction, that "string" tempid needs to be different for each one

👍 1
tatut 2025-05-08T05:08:25.683539Z

I like the lookup refs approach because I don't need to pass a db around when generating the tx data, but good to think about the peer vs transactor

👌 1
ThomasFuston 2025-05-20T19:50:25.308759Z

Love Part 1 - really helpful - can't wait for part 2 :)

1