A demo for setting up datalevin within application.garden projects.
When using Datalevin with file storage back-end, app must be restarted on re-deploy, otherwise you'll see resource unavailable errors or similar:
Platform constant error code: EAGAIN Resource temporarily unavailable (11)
Make sure to include :deploy-strategy :restart
in your garden.edn
file.
These JVM opts are required for Datalevin to access the file storage, make sure to include them in :nextjournal/garden
alias in deps.edn
:
{:aliases
:nextjournal/garden
{:exec-fn your.ns/-main
:jvm-opts ["--add-opens=java.base/java.nio=ALL-UNNAMED"
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"]}}
You can find more details in the Datalevin's install docs.