Fork me on GitHub
#datascript
<
2023-02-06
>
andersmurphy10:02:50

Say if I want to model rounds in a game. Is there an elegant way of doing that? Currently, I just have entity-name/round 1 etc for an entity that happened during round 1 and tracking :round/current as an update in place value. But that seems awkward. I feel like ideally round should be a reference to a round entity rather than just a value. Something like entity-name/round [round/number 1]. Is there a convention/standard approach for modeling desecrate time like rounds/turns in datascript? thanks.

Niki16:02:36

Same with other databases, I think this is called normalization? You want round to be its own entity and reference it by :round/id

andersmurphy16:02:57

Thanks for the quick reply! So it is that straight forward. Just wanted to make sure there wasn’t some fancy datascript/datomic thing I was missing. 😅

andersmurphy16:02:44

Absolutely loving this library. It’s really nice for doing game state. Thank you for making it!

❤️ 2