sql

2023-07-01T14:46:08.428699Z

So I’m trying to use sqlite application defined functions: https://github.com/xerial/sqlite-jdbc/blob/master/src/main/java/org/sqlite/Function.java#L208 This involves extending org.sqlite.Function and overriding the xFunc method. This is trivial in something like groovy:

new Function() {
    protected void xFunc() {
        result("myFunc called!");
    }
But i’m really struggling in Clojure. I’ve been down a :gen-class rabbit hole and I can’t for the life of me call the protected result method:
(ns foo
  (:gen-class
   :extends org.sqlite.Function
   :exposes-methods {result superResult}))

(defn -xFunc [this]
  (.superResult this "myFunc called!"))
I keep getting no method result on class foo taking one arg found. What am I missing?

kolstae 2023-07-04T10:32:55.839849Z

Could you use https://clojuredocs.org/clojure.core/reify#example-542692d5c026201cdc32706f?

2023-07-01T20:22:37.080539Z

So I’ve managed to do a bare bones project where I’ve got it working. So not quite sure what the issue was in my other project. 🤔 I’ll try and get it working in the main project now.