Fork me on GitHub

I remember reading something about the maximum practical length of strings in Datomic but I can't find the discussion. What limit should I set for string length?


So when I use a pull in a find spec ie like

(d/q '[:find (pull ?e [* {:order/line-items
                            [* {:package/size [*]
                                [* {:good/_packages [*]}]}]}])
        :in $ ?person-id
        :where  [?e :order/person ?person-id]]
    (get-db) person-id)
I get a vector of vectors, of the objects I wanted.... is their something more idiomatic then calling flatten ?


I found it

(d/q '[:find [(pull ?e [* {:order/line-items
                             [* {:package/size [*]
                                 [* {:good/_packages [*]}]}]}]) ...]
        :in $ ?person-id
        :where  [?e :order/person ?person-id]]
    (get-db) person-id)
Not sure what that is called, but wrapping the query in another vector unwraps the results.


@bkamphaus: any ideas how I could make the above query faster? or how to know what parts are expensive? I don't have much data yet and it's taking about 950 msecs (returns 24 results)

Ben Kamphaus23:09:04

is person-id a unique attr?

Ben Kamphaus23:09:19

you might bypass query altogether then and just use a lookup ref as the entity identifier in a call to the pull API directly


{:db/id #db/id[:db.part/db] :db/ident :order/person :db/valueType :db.type/ref :db/index true :db/cardinality :db.cardinality/one :db.install/_attribute :db.part/db}


k, I'll try that.