fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
Michael W 2020-08-29T21:16:17.129500Z

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?

Michael W 2020-08-29T22:36:15.132700Z

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

Tyler Nisonoff 2020-08-29T23:22:55.132900Z

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

pserrano 2020-08-29T23:25:32.133900Z

Could/Should I have a fn in my :shared app stuff? It would be a Html5History helper function used by every defsc component

pserrano 2020-08-29T23:35:11.134Z

Have you already transactioned the db schema?

Michael W 2020-08-29T23:40:33.134200Z

Yes, it transacts the schema at app startup.

Michael W 2020-08-29T23:41:49.134400Z

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.

pserrano 2020-08-29T23:41:51.134600Z

Does pulls works?

pserrano 2020-08-29T23:42:50.134800Z

Maybe this is not the correct conn

✔️ 1
Michael W 2020-08-29T23:49:49.135100Z

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.

Michael W 2020-08-29T23:50:12.135400Z

:datomic/prevent-changes? false in the config fixed it.

✔️ 1