Does anyone have experience with native-image compilation and any kind of in-memory DB? SQLite or Duckdb would be best options. Does it work? I've checked out these issues and don't see clear confirmation if it does: https://github.com/duckdb/duckdb-java/issues/180 https://github.com/xerial/sqlite-jdbc/issues/635 https://github.com/xerial/sqlite-jdbc/pull/631 Asking because I'm working in a project that gets compiled with native-image, and having a local db might be helpful sometimes.
you may want to look at how clojure-lsp used this in the earlier days, so you can borrow its configref: eric dallo's comments • discussion here: "sqlite with graalvm native image #635" https://github.com/xerial/sqlite-jdbc/issues/635 • patch here: "[graalvm] Add necessary config for graalvm native-image compilation #631" https://github.com/xerial/sqlite-jdbc/pull/631
check out https://github.com/babashka/babashka-sql-pods all of those pods are compiled to with graalvm
also sqlite should work since early versions of clojure-lsp used that...
hsqldb is one in-memory db that works for sure as evidenced by pods
Sure we use Postgres a lot, and it works. I don't see sqlite on that list but as you're saying it's supported, these is good news
you may want to look at how clojure-lsp used this in the earlier days, so you can borrow its config
for babashka, I went with golang for the sqlite pod since that was easier to work with
I've tried H2 and did not like it. https://github.com/juji-io/datalevin has a command line tool compiled with native image so it should be possible to use as library, but I haven't tried it.
Hsqldb was by far the easiest one to compile I found, in the SQL realm