Description
It's not possible to run the driver on platforms that are not officially supported.
- Regardless of which version of
duckdb_jdbc_* is used, it calls cpuArch and osName unconditionally before it tries to load plain duckdb_java.
Each of them throws IllegalStateException if being run not on one of the hardcoded OS's / architectures.
- There's
OVERRIDE_JDBC_OS_ARCH to enforce the correct arch for the native part, but there's no such option for OS_NAME.
I'd be happy to provide a PR for this.
Any ideas on how to address it?
From my side, I can see the below options.
Suggestions
For the native part
Introduce OVERRIDE_JDBC_OS_NAME.
Option 1 for the Java part (more generic)
Package a properties file that'd contain all the mappings between os.name / os.arch <-> OS / arch used by DuckDBNative, and load it in runtime.
It could contain all the officially supported platforms + extra platforms defined in build time / edited in pre-built jars.
E.g.
<...>
duckdb.os.arch.arm64 = aarch64,arm64
duckdb.os.name.linux = linux
<...>
It'd allow using the official build in the most flexible way.
Option 2 for the Java part (more conservative)
Catch IllegalStateException("Unsupported <...>"), try to load plain duckdb_java. If the latter fails, throw the original error.
Or something like this.
It'd allow using duckdb_jdbc-*-nolib.jar on such platforms.
Thank you.
Description
It's not possible to run the driver on platforms that are not officially supported.
duckdb_jdbc_*is used, it callscpuArchandosNameunconditionally before it tries to load plainduckdb_java.Each of them throws
IllegalStateExceptionif being run not on one of the hardcoded OS's / architectures.OVERRIDE_JDBC_OS_ARCHto enforce the correct arch for the native part, but there's no such option forOS_NAME.I'd be happy to provide a PR for this.
Any ideas on how to address it?
From my side, I can see the below options.
Suggestions
For the native part
Introduce
OVERRIDE_JDBC_OS_NAME.Option 1 for the Java part (more generic)
Package a properties file that'd contain all the mappings between
os.name/os.arch<-> OS / arch used byDuckDBNative, and load it in runtime.It could contain all the officially supported platforms + extra platforms defined in build time / edited in pre-built jars.
E.g.
It'd allow using the official build in the most flexible way.
Option 2 for the Java part (more conservative)
Catch
IllegalStateException("Unsupported <...>"), try to load plainduckdb_java. If the latter fails, throw the original error.Or something like this.
It'd allow using
duckdb_jdbc-*-nolib.jaron such platforms.Thank you.