Fork me on GitHub
#datahike
<
2022-03-08
>
awb9906:03:17

Is it possible to detect new db transactions? I woukd like to run https://github.com/frankiesardo/minikusari rules automatically on top of new datahike transactions. Essentially create calculated fields in an automated way.

Björn Ebbinghaus08:03:34

There is datahike.api/listen But depending on what you want to do, I recommend wrapping transact! or looking into transaction functions

kkuehne16:03:16

Right @U4VT24ZM3, it would also depend on how complex the calculations are and what kind of data you would need from the transaction.

Braden Shepherdson19:03:15

trying to use Datahike under Integrant is proving somewhat frustrating. it feels like at least some components haven't been set up to handle shutdown gracefully. I'm trying to (d/release conn) on halt, and then (d/connect cfg) on startup. I get eg.

Execution error (IllegalArgumentException) at datahike.transactor/eval62640$fn$G (transactor
.cljc:7).                                                                                   
No implementation of method: :shutdown of protocol: #'datahike.transactor/PTransactor found 
for class: datahike.transactor.LocalTransactor 

Braden Shepherdson19:03:31

which seems weird, because there's totally an implementation of shutdown right there.

Braden Shepherdson19:03:18

I think I'm having trouble with reloading these namespaces live, so there are actually different classes/interfaces with the same name floating around. let me check my Reloaded setup.

timo07:03:22

which backend are you using?

Braden Shepherdson20:03:32

I've so far sidestepped the problem by using more targeted reloads into the REPL, rather than full-scale :reload-all

timo07:03:02

ok, I used datahike with components and it worked...keep me posted if you have a problem regarding datahike.