This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-18
Channels
- # babashka (12)
- # beginners (35)
- # biff (6)
- # calva (23)
- # cider (7)
- # clj-kondo (10)
- # cljs-dev (15)
- # clojure (81)
- # clojure-dev (2)
- # clojure-europe (13)
- # clojure-germany (1)
- # clojure-korea (2)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-uk (7)
- # clojurescript (23)
- # core-typed (33)
- # cursive (7)
- # data-science (7)
- # datalevin (9)
- # hyperfiddle (1)
- # introduce-yourself (2)
- # malli (1)
- # matrix (17)
- # missionary (24)
- # music (1)
- # off-topic (15)
- # polylith (6)
- # reagent (10)
- # releases (5)
- # remote-jobs (1)
- # shadow-cljs (3)
- # squint (7)
- # xtdb (11)
- # yamlscript (6)
0.9.5 is released. https://github.com/juji-io/datalevin/blob/master/CHANGELOG.md#095-2024-04-17
I'm trying to figure out how to an atomic "read-then-write", the README mentions transaction functions and something called intern-fn
, but I can't find any other reference to what this is. Are transaction functions supported?
https://github.com/juji-io/datalevin/blob/master/doc/transact.md#explicit-transaction
with-transaction
is what you are looking for I believe.
Yes, use with-transaction
for atomic actions. inter-fn
is for cases when the function needs to be serialized, e.g. when trying to save this function in DB as a :db/fn
, or pass this function over the wire to server/babashka
This inter-fn
macro is necessary in order to accommodate GraalVM native image, because eval
cannot be used in native image, which has a closed world assumption. This macro method is the only way that I come up with that allows serialization of functions without eval
. The source code of the function will be interpreted by sci, so there's currently some limitations, e.g. except for built-in ones, Clojure vars are not accessible. We will address these limitations later.
So if you want to use a stored transaction function using :db/fn
it needs to be declared using inter-fn
, or definterfn
, etc.