diff --git a/CMakeLists.txt b/CMakeLists.txt index d47f2fbf..9515987d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2}) include_directories(src/duckdb/src/include src/duckdb/third_party/concurrentqueue src/duckdb/third_party/fast_float src/duckdb/third_party/fastpforlib src/duckdb/third_party/fmt/include src/duckdb/third_party/fsst src/duckdb/third_party/httplib src/duckdb/third_party/hyperloglog src/duckdb/third_party/jaro_winkler src/duckdb/third_party/jaro_winkler/details src/duckdb/third_party/libpg_query src/duckdb/third_party/libpg_query/include src/duckdb/third_party/lz4 src/duckdb/third_party/mbedtls src/duckdb/third_party/mbedtls/include src/duckdb/third_party/mbedtls/library src/duckdb/third_party/miniz src/duckdb/third_party/pcg src/duckdb/third_party/re2 src/duckdb/third_party/skiplist src/duckdb/third_party/tdigest src/duckdb/third_party/utf8proc src/duckdb/third_party/utf8proc/include src/duckdb/third_party/yyjson/include src/duckdb/extension/parquet/include src/duckdb/third_party/parquet src/duckdb/third_party/thrift src/duckdb/third_party/lz4 src/duckdb/third_party/snappy src/duckdb/third_party/zstd/include src/duckdb/third_party/mbedtls src/duckdb/third_party/mbedtls/include src/duckdb/extension/icu/include src/duckdb/extension/icu/third_party/icu/common src/duckdb/extension/icu/third_party/icu/i18n src/duckdb/extension/json/include) add_definitions(-DDUCKDB_EXTENSION_PARQUET_LINKED -DDUCKDB_EXTENSION_ICU_LINKED -DDUCKDB_EXTENSION_JSON_LINKED) +add_definitions(-DDUCKDB_EXTENSION_AUTOLOAD_DEFAULT=1 -DDUCKDB_EXTENSION_AUTOINSTALL_DEFAULT=1) file(GLOB_RECURSE JAVA_SRC_FILES src/main/java/org/duckdb/*.java) file(GLOB_RECURSE JAVA_TEST_FILES src/test/java/org/duckdb/*.java) diff --git a/src/test/java/org/duckdb/TestDuckDBJDBC.java b/src/test/java/org/duckdb/TestDuckDBJDBC.java index cb5d6c6a..4e418e13 100644 --- a/src/test/java/org/duckdb/TestDuckDBJDBC.java +++ b/src/test/java/org/duckdb/TestDuckDBJDBC.java @@ -3228,6 +3228,26 @@ public static void test_boolean_config() throws Exception { } } + public static void test_autoloading_config() throws Exception { + Properties config = new Properties(); + try (Connection conn = DriverManager.getConnection(JDBC_URL, config); + PreparedStatement stmt = conn.prepareStatement("SELECT current_setting('autoload_known_extensions')"); + ResultSet rs = stmt.executeQuery()) { + rs.next(); + assertEquals("true", rs.getString(1)); + } + } + + public static void test_autoinstall_config() throws Exception { + Properties config = new Properties(); + try (Connection conn = DriverManager.getConnection(JDBC_URL, config); + PreparedStatement stmt = conn.prepareStatement("SELECT current_setting('autoinstall_known_extensions')"); + ResultSet rs = stmt.executeQuery()) { + rs.next(); + assertEquals("true", rs.getString(1)); + } + } + public static void test_readonly_remains_bug5593() throws Exception { Path database_file = Files.createTempFile("duckdb-instance-cache-test-", ".duckdb"); database_file.toFile().delete();