diff --git a/deps.edn b/deps.edn index c3d3ff9..8dd7325 100644 --- a/deps.edn +++ b/deps.edn @@ -1,5 +1,6 @@ {:paths ["src" "lib"] :deps {techascent/tech.ml.dataset {:mvn/version "7.026"} + cnuernber/dtype-next {:mvn/version "10.111"} techascent/tech.ml.dataset.sql {:mvn/version "7.000-beta-52"} net.java.dev.jna/jna {:mvn/version "5.13.0"}} :aliases diff --git a/src/tmducken/duckdb/ffi.clj b/src/tmducken/duckdb/ffi.clj index 0b10ab1..34a7765 100644 --- a/src/tmducken/duckdb/ffi.clj +++ b/src/tmducken/duckdb/ffi.clj @@ -480,23 +480,23 @@ all memory associated with the appender. (defonce blob-def* (delay (dt-struct/define-datatype! :duckdb-blob [{:name :data - :datatype @ptr-dtype*} + :datatype :pointer} {:name :size :datatype :uint64}]))) (defonce column-def* (delay (dt-struct/define-datatype! :duckdb-column [{:name :data - :datatype @ptr-dtype*} + :datatype :pointer} {:name :nullmask - :datatype @ptr-dtype*} + :datatype :pointer} ;;duckdb-type {:name :type :datatype :int32} {:name :name - :datatype @ptr-dtype*} + :datatype :pointer} {:name :internal_data - :datatype @ptr-dtype*}]))) + :datatype :pointer}]))) (defonce result-def* (delay @@ -508,11 +508,11 @@ all memory associated with the appender. {:name :rows-changed :datatype :uint64} {:name :columns - :datatype @ptr-dtype*} + :datatype :pointer} {:name :error-message - :datatype @ptr-dtype*} + :datatype :pointer} {:name :internal-data - :datatype @ptr-dtype*}]))) + :datatype :pointer}]))) @@ -520,40 +520,40 @@ all memory associated with the appender. (delay (dt-struct/define-datatype! :duckdb-logical-type [{:name :__lglt - :datatype @ptr-dtype*}]))) + :datatype :pointer}]))) (defonce data-chunk-def* (delay (dt-struct/define-datatype! :duckdb-data-chunk [{:name :__dtck - :datatype @ptr-dtype*}]))) + :datatype :pointer}]))) (defonce vector-def* (delay (dt-struct/define-datatype! :duckdb-vector [{:name :__vec - :datatype @ptr-dtype*}]))) + :datatype :pointer}]))) (defonce appender-def* (delay (dt-struct/define-datatype! :duckdb-appender [{:name :__appn - :datatype @ptr-dtype*}]))) + :datatype :pointer}]))) (defonce prepared-statement-def* (delay (dt-struct/define-datatype! :duckdb-prepared-statement [{:name :__prep - :datatype @ptr-dtype*}]) + :datatype :pointer}]) (dt-struct/define-datatype! :duckdb-extracted-statements [{:name :__extrac - :datatype @ptr-dtype*}]) + :datatype :pointer}]) (dt-struct/define-datatype! :duckdb-pending-result [{:name :__pend - :datatype @ptr-dtype*}]) + :datatype :pointer}]) )) diff --git a/test/tmducken/duckdb_test.clj b/test/tmducken/duckdb_test.clj index 76331e2..838edbc 100644 --- a/test/tmducken/duckdb_test.clj +++ b/test/tmducken/duckdb_test.clj @@ -15,6 +15,17 @@ (duckdb/initialize!) +(comment + (require '[tech.v3.datatype.ffi.mmodel-jdk21 :as mm]) + (def cls-def (mm/define-library duckdb-ffi/lib-fns nil nil)) + (def lib-path (str (java.nio.file.Paths/get (System/getenv "DUCKDB_HOME") + (into-array String [(System/mapLibraryName "duckdb")])))) + (def sym (mm/load-library lib-path)) + (def inst (tech.v3.datatype.ffi/instantiate-library cls-def sym)) + (tech.v3.datatype.ffi/library-singleton-set-instance! duckdb-ffi/lib inst) + ) + + (def db* (delay (duckdb/initialize!) (duckdb/open-db)))