Fork me on GitHub
#datomic
<
2016-04-09
>
Ben Kamphaus01:04:55

@randyt it's hard to tackle that question generically, but I think the basic point would be that yes, multi-table data can be migrated to Datomic usually and depending on e.g. how the tables are typically joined to answer questions, a Datomic schema may be a better fit, especially if it involves implied graphs, card many values, varying presence/absence of fields, etc.

Ben Kamphaus01:04:08

I doubt there will be a generic ETL tool you can grab if the best fit for your data is a model fundamentally different in some ways than the relational/table model.

randyt17:04:07

@bkamphaus: thanks for the feedback

mjhamrick20:04:50

If you know that you are transacting to only one entity, (only one map literal), what is the best way to get the entity id you transacted to from the transaction future. I was doing this via

(defn- get-e-id-for-transaction
  [transaction-future]
  ((comp first vals :tempids)
   @transaction-future))
But I realized that only works if you are transacting to a new entity since there won't be tempids in that case.

hiredman20:04:09

http://docs.datomic.com/clojure/#C03RZMDSH.api/transact says :tx-data cotnains the datoms produced by a transaction, so maybe mapping first over that?

hiredman20:04:35

oh, right, the operation type, so not first, but you may be able to get entity ids there

mjhamrick20:04:46

Thanks, I'll give that a shot.

mjhamrick20:04:03

Got something working. Thanks @hiredman

(-> test-db-name
            d/connect
            (d/transact [{:db/id #db/id[:db.part/user]
                          ;; transact something here
                          }])
            deref
            :tx-data
            second ;; This used to say first, but the first datom is the transaction
            .e
            )