Skip to content

Commit

Permalink
Merge pull request #19 from carlopi/defaults
Browse files Browse the repository at this point in the history
Enable autoload and autoinstall of known extensions by default
  • Loading branch information
hannes authored Jun 3, 2024
2 parents f771f4c + bf7321f commit 6207631
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 20 additions & 0 deletions src/test/java/org/duckdb/TestDuckDBJDBC.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6207631

Please sign in to comment.