v0.5.2
Upgrade instructions:
- Change Biff's
:sha
value indeps.edn
to780d76fde5adbd3d7edd3e3e2020b77ddcef513f
. - Apply the changes in these commits: 2733f75, 580adb4, and be7aeef (see the comment). Note that the changes in
setup.sh
will need to be done on the server. - Install Babashka if you haven't already.
Changed:
- The
task
shell script has been replaced with Babashka tasks. e.g. now you'll runbb dev
instead of./task dev
, etc. The task implementations are now stored as library code, so if they need to be updated in future releases, it will not require any manual changes to upgrade. use-chime
anduse-tx-listener
now take a:biff/features
option instead of:biff.chime/tasks
and:biff.xtdb/on-tx
options, respectively. This eliminates the need for some of the code in your project's main namespace. (The previous options are still recognized for backwards compatibility.)use-xt
now accepts a:biff.xtdb/tx-fns
option, for creating transaction functions on startup. There is also abiff/tx-fns
value which contains a:biff/ensure-unique
transaction function.biff/submit-tx
is more flexible: (1) XT operations can be mixed in with Biff operations (useful for calling transaction functions); (2) you can provide a function that returns a Biff transaction, which will be called again each time the transaction is retried (i.e. if there's contention); (3) there is a:biff.xtdb/retry
option which, iffalse
, will return immediately instead of awaiting the tx and retrying on contention (defaulttrue
).- The
biff/lookup
andbiff/lookup-id
functions now take a variable number of key-value pairs.
Added:
biff/submit-tx
's implementation has been broken up into two new functions:biff/biff-tx->xt
, which converts a Biff transaction to an XT transaction, andbiff/submit-with-retries
, which submits an XT transaction and retries if there's contention.
Deprecated:
:db/lookup
operations should be replaced with transaction functions. See 580adb4. I decided that I prefer to use a transaction function for uniqueness checks because using match operations could fail to enforce uniqueness if you e.g. previously created a document without using:db/lookup
. Transaction functions will always work.
In addition, the reference documentation is all up to date, and I have even added a test 🙂.