Fork me on GitHub
#datomic
<
2019-01-10
>
m_m_m16:01:50

I've spend on that so much time. What is wrong with that query: https://pastebin.com/TvgmasTw my error is: (q__36748 ?block_nr), message: processing clause: [ :blocknr ?block_nr], message: :db.error/not-an-entity Unable to resolve entity: :item/block_nr what is wrong with that entity? I just want a simple aggregation.

marshall17:01:19

the error suggests that :item/block_nr is not an installed attribute name in your database

m_m_m17:01:50

@marshall which is strange becoude my schema is: https://pastebin.com/CUwY6JqP so there is :item/block_nr 😞

marshall17:01:47

can you pull it or query for it? i.e. (d/pull (d/db conn) '[*] :item/block_nr)

marshall17:01:05

user=> @(d/transact conn [{:db/ident :item/block_nr :db/valueType :db.type/string :db/cardinality :db.cardinality/one :db.install/_attribute :db.part/db}])
{:db-before datomic.db.Db@ddc3ac99, :db-after datomic.db.Db@8bbee296, :tx-data [#datom[13194139534312 50 #inst "2019-01-10T17:30:14.567-00:00" 13194139534312 true] #datom[63 10 :item/block_nr 13194139534312 true] #datom[63 40 23 13194139534312 true] #datom[63 41 35 13194139534312 true] #datom[0 13 63 13194139534312 true]], :tempids {-9223301668109598143 63}}
user=>
user=> (d/pull (d/db conn) '[*] :item/block_nr)
#:db{:id 63, :ident :item/block_nr, :valueType #:db{:id 23}, :cardinality #:db{:id 35}}
(d/q '[:find (max ?block_nr)
                    :where [_ :item/block_nr ?block_nr]]
                  (d/db conn))
[]
user=>

marshall17:01:15

^ I’d suspect that your schema didn’t get transacted for some reason

marshall17:01:18

{:db/ident              :item/amount
  :db/valueType          :db.type/number
  :db/cardinality        :db.cardinality/one
  :db.install/_attribute :db.part/db}

marshall17:01:31

:db.type/number is not a valid db type @m_m_m

m_m_m17:01:27

Thank you!

m_m_m17:01:38

what a stupid mistake!

marshall17:01:50

happens to all of us 🙂

apsey18:01:05

Is there an official docker image for the Datomic Transactor from Cognitect? Has anyone used this one? https://hub.docker.com/r/pointslope/datomic-pro-starter/dockerfile/ Use case is: running transactors inside kubernetes to avoid running standby transactors (half the cost without the ec2 boot time) and better embrace resource usage within kubernetes (having less idle resources).