Expose db memory address and path to libduckdb_java.so#87
Expose db memory address and path to libduckdb_java.so#87Jens-H wants to merge 4 commits intoduckdb:mainfrom
Conversation
|
No idea why the format check failed - locally it runs without errors. Maybe the non-ASCII chars ... @Mause Any idea? Or may we ignore it? |
|
Looks like it might be an encoding thing yeah. As far as the change goes, why return the memory address as a string? And I'd like to see some kind of javadoc on the memory method at least mentioning the unsafety |
|
Sadly a string seems to be the simplest and secure way without having pointers and unsigned 64 bit integers in Java/JNI return types. You're right, some kind of warning seems appropriate. I'll add that. |
|
Can you expand on why returning a pointer cast to an integer via jni is unsafe? |
|
Well, basically I'm not sure if casting the memory address like this will work everywhere (Linux-AMD64 seems ok): Maybe you can confirm that this should be fine. Then I'm happy to change the PR accordingly. |
|
I created a new PR #115 where the cast to string is replaced by a cast to long. |
This PR adds two methods to the DuckDBConnection object to:
With these two pieces of information, it should be possible to create db connections with another driver like e.g. https://github.com/techascent/tmducken for Clojure in parallel. (By the way: this driver is not yet mentioned on the homepage as third-party driver.)