Fork me on GitHub
#datomic
<
2024-03-06
>
adham13:03:56

Just learned about conditional queries from https://grishaev.me/en/datomic-query/ and used it to make a function with map options to filter for :location and :flagged-entries? for whether an entry has been flagged or not.

Joe Lane17:03:02

I once made a a sql-as-json to datalog compiler with a similar approach. Was delightfully simple.

mlimotte14:03:23

Is it safe to use a datomic d/db value inside a delay? In many cases, the delay would be derefed within seconds, but sometime never and sometime it could be hours later. Presumably, the db is related to a connection, so I’m concerned the connection will expire in some way? If it matters: I have an on-prem installation, using dynamodb storage.

chrisblom16:03:04

yes this is safe. A db is created from a connection, as long as the connection is working, db's can be created.

souenzzo17:03:45

it is safe but there is no reason to do that. d/db is cheap.

mlimotte17:03:00

I want to keep the db value at the basis-t that the delay is created.

mlimotte17:03:30

The delay contains a lot of logic/processing, not just a db

souenzzo17:03:36

call d/db will not do any extra computation. fetch conn asking for newer db or anything like that. will just return the db that is already in-memory. it is like deref. d/sync it the one "talk with the transaction and give-me the newest db possible"

mlimotte17:03:50

Thanks for the confirmation, Chris, Enzzo.