diff --git a/deps.edn b/deps.edn index 910fb54..9f96b7b 100644 --- a/deps.edn +++ b/deps.edn @@ -3,7 +3,7 @@ ;; babashka/ffi repository. :deps {io.github.babashka/ffi {:git/url "https://github.com/babashka/ffi" - :git/sha "40fcd2784b94a062e98b4de29431450e852c57ca"}} + :git/sha "e4700ac76a61f7f3a7755fafa5784a2f86f6d137"}} :aliases {:test {:extra-paths ["test"] :extra-deps {io.github.cognitect-labs/test-runner diff --git a/src/babashka/sqlite.clj b/src/babashka/sqlite.clj index bc833c1..c9dcba1 100644 --- a/src/babashka/sqlite.clj +++ b/src/babashka/sqlite.clj @@ -140,7 +140,7 @@ ^bytes [n p] (if (pos? n) ;; a pointer from C has size 0; give it the blob's size first - (ffi/read-bytes (ffi/reinterpret p n) n) + (ffi/read-array (ffi/reinterpret p n) :byte n) (byte-array 0))) ;; sqlite types values per cell, not per column @@ -166,7 +166,7 @@ (bytes? v) (with-open [arena (ffi/confined-arena)] (let [n (alength ^bytes v) p (ffi/alloc arena (max n 1))] - (ffi/write-bytes p v) + (ffi/write-array p :byte v) (c-bind-blob stmt i p n sqlite-transient))) :else (throw (ex-info (str "sqlite3: cannot bind " (type v)) {:value v})))] @@ -227,7 +227,7 @@ (bytes? v) (with-open [arena (ffi/confined-arena)] (let [n (alength ^bytes v) p (ffi/alloc arena (max n 1))] - (ffi/write-bytes p v) + (ffi/write-array p :byte v) (c-result-blob ctx p n sqlite-transient))) :else (c-result-error ctx (str "cannot return " (type v) " from a function") -1)))