graalvm

igrishaev 2025-11-28T09:23:06.915249Z

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.

adi 2025-12-01T18:37:23.862309Z

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

borkdude 2025-11-28T09:24:12.117139Z

check out https://github.com/babashka/babashka-sql-pods all of those pods are compiled to with graalvm

borkdude 2025-11-28T09:24:41.822539Z

also sqlite should work since early versions of clojure-lsp used that...

borkdude 2025-11-28T09:25:02.632579Z

hsqldb is one in-memory db that works for sure as evidenced by pods

igrishaev 2025-11-28T09:26:25.630489Z

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

borkdude 2025-11-28T09:26:58.068899Z

you may want to look at how clojure-lsp used this in the earlier days, so you can borrow its config

borkdude 2025-11-28T09:27:17.658729Z

for babashka, I went with golang for the sqlite pod since that was easier to work with

phronmophobic 2025-11-28T12:33:33.567159Z

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.

👍 1
borkdude 2025-11-28T12:35:55.766009Z

Hsqldb was by far the easiest one to compile I found, in the SQL realm