Fork me on GitHub
#datahike
<
2021-07-08
>
wei18:07:02

hi, thanks for making datahike! I had a question about the single-connection restriction. I followed this template to generate a postgres-backed datahike app on heroku (https://nextjournal.com/kommen/datahike-heroku-datalog-clojure-web-app) and I found that I could actually connect to the database locally. however when I execute transactions locally it sometimes shows up in the db and sometimes doesn't. is there a way to flush transactions to the db, or is this a limitation of datahike and i shouldn't be trying to connect to it from my local machine while the app is also connected? thanks!

Joshua Suskalo23:07:13

My understanding of the way datahike works is that it caches things when it queries them. In order for you to see the transactions from another location, you have to close and re-open the connection for now. In the future there will be support for read-only peers which will do this automatically for you, there's a PR for it, but it's not been merged yet.

👍 4
Joshua Suskalo23:07:05

Even in this case though, you shouldn't have multiple writing peers.