Fork me on GitHub
#datascript
<
2023-10-11
>
shader19:10:54

has anyone else run into an issue where entity references aren't "live" in pull results like they are in an entity?

shader19:10:46

like, the reference will print as #{db <n>} , but if I try to get any attributes from it they all return nil...

sergey.shvets19:10:45

can it be that you hold an old db atom? For example, if you deref db before making a change, you'll still have an old database state in that variable.

shader19:10:04

Pretty sure that's not the issue. To be precise, I've never gotten a working reference from a pull. Maybe it's intentional, and I need to do some kind of recursive pull?

hiredman20:10:25

What is (type #{db <n>}) returning?

jjttjj12:10:27

> Maybe it's intentional, and I need to do some kind of recursive pull? Yeah I think it's this. What's the code you're running? d/entity is supposed to return "live" results that can traverse the db, d/pull doesn't it just returns the data you ask of it