Fork me on GitHub

There is eventually also different way to use SQLite. By using Graalvm polyglot API and sulong.


It's slightly difficult for me to explain, since I'm not C/C++ experienced. But in theory, you can compile SQLite using llvm-toolchain to llvm-bitcode and than using sulong and polyglot to interact and interop with such compiled sqlite shared object. There is a notation to map structures from native-c as described here: Obviosly it's a great deal of work.


To demonstrate something visible everyone can run SQLite on JVM by doing following on sqlite source:

export CC=$(lli --print-toolchain-path)/gcc
$CC -o sqlite -DSQLITE_THREADSAFE=0 shell.c sqlite3.c -ldl
lli --jvm sqlite
the last command actually runs sqlite compiled to llvm-bitcode with sulong interpreter directly on JVM. To interact with such a thing of course there has to be some envelope. It would be a great project for some Oracle Labs intern. I mean great example of the capabilities.


It's probably wrong on some assumptions, but still...


That would be interesting, but would require writing a the interaction from top to bottom, versus being able to use existing JDBC code


the current JDBC drivers include the native binaries in the jar and move them around, which doesn't seem to play well with native image and clojure (at least as far as I've been able to manage).