Fork me on GitHub
#datomic
<
2018-02-23
>
thosmos04:02:40

I'm having some trouble calling a local function inside of a peer query:

(d/q '[:find ?ft
           :where
           [_ :sitevisit/SiteVisitDate ?date]
           [(hello ?date) ?ft]]
      db)
I'm getting this error: CompilerException java.lang.RuntimeException: Unable to resolve symbol: hello in this context, compiling:(NO_SOURCE_PATH:54:9) is there something I'm missing? regular std lib functions work fine. this function is declared directly before the function that contains this query.

robert-stuttaford07:02:57

you need to use fully-qualified namespace names, @thosmos your-ns/hello

thosmos07:02:02

oh, of course! thanks @robert-stuttaford

souenzzo14:02:21

can I restore a backup into a memory database?

marshall14:02:08

@souenzzo No, there is no out-of-process access to mem databases

adamfrey19:02:07

if I have a datomic.db.Datum object is there a way to clone it? My ultimate goal is to convert datoms with byte arrays as their values into datoms with equivalent strings as their values.

favila19:02:18

The constructor requires e a-without-partition-bits, object, and tx with the op bit set (called tOp)

favila19:02:27

these are all public fields so you can just copy them

favila19:02:03

(Datum. (.e dat) (.a dat) (.v dat) (.tOp dat))

favila19:02:23

none of this is part of the public documented api though, so be careful

adamfrey19:02:39

thanks @U09R86PA4. I saw .tOp in the class info but I thought it was .t0p with a zero and that didn't work

favila20:02:26

means "t plus asserted/deleted"

favila20:02:45

so the t value (not tx) shifted left one bit; last bit is 0 for retract and 1 for assert

favila20:02:15

Op = operation