Database and entity functions


Hi guys,

When using the Client API (with Datomic Cloud or locally with a Peer Server), is there any way to use the database functions?

I have 2 use cases:

  1. A custom transaction (database) function.
  2. An entity function (i.e. as a :db.type/fn attribute).

Currently, I am getting the following exception when trying to add a function built with (datomic.api/function …):

java.lang.RuntimeException: java.lang.Exception: Not supported: class clojure.lang.Delay

Many thanks,



With Datomic Cloud, you’ll need to create your functions as Ions ( and in order to deploy them to your running Cloud instance.

In Datomic On-Prem, you would need to install your database function in a transaction ( The day-of-datomic examples include some Peer library code demonstrating this (