Fork me on GitHub
#datomic
<
2021-02-25
>
babardo13:02:21

simple question, what datomic.client.api/delete-database does in Datomic Cloud ? • is the operation revertable? • do we still keep past transactions in s3?

babardo14:02:35

oh I missed that thx 🙏 I guess we have the same behavior for datomic cloud

donavan14:02:25

What’s the easiest way to insert ref entities; I’d imagine doing something like this but it doesn’t work:

(d/transact
     conn
     {:tx-data
      '(#:sub-thing{:some-field "some-data"
                    :_thing/sub-things [:thing/id "some-application-level-id"]})})

donavan14:02:58

I guess this is it

(d/transact
     conn
     {:tx-data
      [{:thing/id "some-application-level-id"
        :thing/sub-things '(#:sub-thing{:some-field "some-data"})}]})

souenzzo15:02:18

Hey @U0VP19K6K As far I know, you can always use [] '() are just more complex to write Here your examples expanded

;; first try
{:tx-data [#:sub-thing{:some-field        "some-data"
                       :_thing/sub-things [:thing/id "some-application-level-id"]}]}
=> {:tx-data [{:sub-thing/some-field "some-data"
               :_thing/sub-things    [:thing/id "some-application-level-id"]}]}
;; Second try
{:tx-data [{:thing/id         "some-application-level-id"
            :thing/sub-things [#:sub-thing{:some-field "some-data"}]}]}
=> {:tx-data [{:thing/id         "some-application-level-id"
               :thing/sub-things [{:sub-thing/some-field "some-data"}]}]}

souenzzo15:02:43

In the first case, I think that you miswrite the "reverse reference" I think that you tryied to write this:

{:tx-data [#:sub-thing{:some-field  "some-data"
                       :_sub-things [:thing/id "some-application-level-id"]}]}
=> {:tx-data [{:sub-thing/some-field  "some-data"
               :sub-thing/_sub-things [:thing/id "some-application-level-id"]}]}

donavan15:02:27

Thanks, yeah I just copied that from a much larger tree that I was generating programatically, I don’t normally write manual lists 😄

✔️ 3
donavan15:02:04

Good spot re. the reverse reference…

donavan15:02:35

Again, mixing up data that was from repl output with hand written modifications

donavan15:02:06

So are the reverse references valid in tx-data entities like that? (I will test later regardless)

souenzzo15:02:20

I think that yes, but I already had some issues using lookup references in some places. Sometimes it feels intuitive to use them, but in pratice you need to resolve and use "the db id" For example I had issues with [:db/cas e a v0 v1] when v0 is an entity, I tryied to use lookup ref and datomic do not accept its IMHO it's a bug from datomic and not sure if in newer versions it's fixed. lookup reference - when you do [:an-unique-attr "it's value"]

donavan15:02:12

Ah cool, thanks for the info! 🙂 I didn’t know if it was possible so just reverted to the second approach above without thinking too hard about it.

souenzzo15:02:44

i reported that cas bug in a portal that i think that do not exists anymore 😅

xceno19:02:57

Does anyone know if the https://github.com/uncomplicate/neanderthal stack (specifically the intel-MKL dependency `[org.bytedeco/mkl-platform-redist "2020.3-1.5.4"]`) "just works" on a datomic ion project, or would I have to tinker with the EC2 Compute Instances/Templates?

Joe Lane19:02:56

intel-MKL uses AVX operations. Just make sure you're using an instance that supports that. Please don't "tinker" with the instance templates.

xceno19:02:51

Alright thanks! I asked because i specifically don't want to mess with the templates, so no worries! 😉

Joe Lane19:02:41

FWIW, this isn't a green light expecting everything to work perfectly out of the box. I think you should try it and report back.

xceno19:02:10

Got it! I'll just try and see how it goes then