dwhjames / datomisca

Datomisca: a Scala API for Datomic
https://dwhjames.github.io/datomisca/
Apache License 2.0
130 stars 28 forks source link

Add ability to get an optional EID from a lookup ref #118

Closed GitsMcGee closed 10 years ago

GitsMcGee commented 10 years ago

The situation comes up from time to time where I have some sort of lookup ref, such as an email address for example, but I do not know for sure if a user entity with that email address exists yet in the DB. Currently, if I try to grab the associated entity for the lookup ref, it will throw an exception. In the cases where I know that my lookup ref might not turn anything up, I'd like to be able to ask for an Option instead.

dwhjames commented 10 years ago

Does this handle your use case? https://github.com/pellucidanalytics/datomisca/blob/v0.7-alpha-11/core/src/main/scala/datomisca/DId.scala#L49-L69

GitsMcGee commented 10 years ago

Well look at that. Yes, this is exactly what I was looking for.

Nothing to see here folks!