how to access the database from the repl using fulcro-rad? I want to create some new queries but want to play with them manually so I can see what I would get. Do I need to use the datamic library directly or can I get access to the database from the environment outside a resolver or mutation?
I'm really confused actually. I used datomic.api, connected to my local datomic free, and I have the fulcro-rad demo running, but I can't seem to query for any of the idents. :invoice/id :item/name, :customer/name everything I try to query says the entity cannot be resolved. I can click in the demo app and see these things in the app, but trying to query datomic for them I get entity errors.
(d/q '[:find ?e :where [?e :customer/name "Sam"]] (d/db conn))
Execution error (Exceptions$IllegalArgumentExceptionInfo) at datomic.error/arg (error.clj:79).
:db.error/not-an-entity Unable to resolve entity: :customer/name
are you branched off of the rad demo?
if you look at the demo, theres a ns com.example.components.datomic
that has a (defstate datomic-connections ...)
the development
ns uses that to seed the db -- should be able to do something similar in the REPL or something to get a connection to the db you're using
Could/Should I have a fn in my :shared app stuff? It would be a Html5History
helper function used by every defsc component
Have you already transactioned the db schema?
Yes, it transacts the schema at app startup.
There is something going on in the fulcro-rad-datomic adapter that I don't understand to translate pathom queries to datomic, and I am not good enough at clojure to understand exactly what is happening.
Does pulls works?
Maybe this is not the correct conn
Doh, thanks for the rabbit hole, apparently I had changes disabled in the config. It looked like it was transacting but it was not ever sending changes to the db.
:datomic/prevent-changes? false in the config fixed it.