Fork me on GitHub

Hi. Are custom query functions supported? I'm using the datalevin babashka pod and get the following error when trying to use a custom query function: Unknown function 'my-fn in [(my-fn) ?greeting]

(defn my-fn

  (d/q '[:find ?greeting
         :in $
         [(my-fn) ?greeting]]
       (d/db conn))


Query function is supported in Datalevin if you use from Clojure. But if you are using babashka, you will need to make sure your function is available for Datalevin’s sci (


i have not tried this use case, so if you want to do some investigation and figure out what’s missing, that would be great


datalevin uses its own copy of sci, so it does not know about your function that’s defined in babashka’s sci


i think that’s the issue


if you don’t have time to investigate, file an issue, i will see if I can get around to take a look


Thanks. I'll do some investigation later on and file an issue if I'm not able to figure it out


@U0A74MRCJ I did some investigation but unfortunately I was defeated. I think I'd need to learn more about how babashka pods work and clojure in general to know the correct approach to take here. I resorted to creating an issue I'm happy to help with testing if you do get round to looking into this. In the meantime, I'm tempted to switch my project over to using clojure instead of babashka.