biff

jcd 2024-04-01T20:22:12.218179Z

I am playing around with biff to build a toy application, and I am struggling a bit with biff/submit-tx . I think this is clearly a case of me holding it wrong, since I worked through the tutorial pretty easily, but I can't seem to make a simple delete call work. I have something like this:

(biff/submit-tx ctx
                      [{:db/op :delete
                        :db/doc-type :game
                        :game/id guid}])
And I get a bad implementation message:
java.lang.IllegalArgumentException: No implementation of method: :submit-tx of protocol: #'xtdb.api/PXtdbSubmitClient found for class: nil

2024-04-15T18:36:09.339499Z

very common error, special message would be helpful for newcomers

👍 1
jcd 2024-04-01T20:58:27.848179Z

this was... a good one.

jcd 2024-04-01T20:58:52.029099Z

I miskeyed the :keys destructuring in my function signature.

jcd 2024-04-01T21:01:18.101929Z

{:keys [biff/db session :as ctx]} Anyway, I sorted it out.

2024-04-01T21:55:46.688889Z

ha glad you got it working! but yeah, for future reference, that kind of error message usually means the wrong thing is getting passed in for ctx. I oughtta have submit-tx/other functions check for that immediately and give a better error message.