Skip to content

Commit 258866f

Browse files
committed
Enable rs streaming and DB pinning for DuckLake
This is a manual backport of the PR duckdb#258 to `v1.3-ossivalis` stable branch. The support for direct attach, was recently added to DuckLake in duckdb/ducklake#201. JDBC connection string example: ``` jdbc:duckdb:ducklake:postgres:postgresql://user:[email protected]:5432/lake1 ``` This change enables `jdbc_stream_results` and `jdbc_pin_db` options by default (unless they are specified by user) for DuckLake connections. Testing: test coverage pending as DuckLake is not yet available in the `main` barnch.
1 parent 89e93bc commit 258866f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/org/duckdb/DuckDBDriver.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class DuckDBDriver implements java.sql.Driver {
3232

3333
static final String DUCKDB_URL_PREFIX = "jdbc:duckdb:";
3434
static final String MEMORY_DB = ":memory:";
35+
private static final String DUCKLAKE_URL_PREFIX = DUCKDB_URL_PREFIX + "ducklake:";
3536

3637
static final ScheduledThreadPoolExecutor scheduler;
3738

@@ -102,6 +103,12 @@ public Connection connect(String url, Properties info) throws SQLException {
102103
// to be established.
103104
props.remove("path");
104105

106+
// DuckLake connection
107+
if (pp.shortUrl.startsWith(DUCKLAKE_URL_PREFIX)) {
108+
setDefaultOptionValue(props, JDBC_PIN_DB, true);
109+
setDefaultOptionValue(props, JDBC_STREAM_RESULTS, true);
110+
}
111+
105112
// Pin DB option
106113
String pinDbOptStr = removeOption(props, JDBC_PIN_DB);
107114
boolean pinDBOpt = isStringTruish(pinDbOptStr, false);

0 commit comments

Comments
 (0)