Commit 546c388
committed
Support auto-initializing DuckLake
There is a usability gap with using DuckLake with JDBC, when a
connection must be opened first and then the following statement must
be executed:
```
ATTACH 'ducklake:...'
```
Executing this additional `ATTACH` step, when accessing DuckLake from
GUI tools or from high-level engines like Spark, is cumbersome and may
require non-trivial configuration.
This change adds two new connection properties:
1. `ducklake`: the `database-path` parameter to pass to
`ATTACH '<database-path>'`.
Value examples:
```
/path/to/lake1.db
sqlite:/path/to/lake1.db
postgres:postgresql://user:pwd@127.0.0.1:5432/lake1
```
If `ducklake:` prefix to the value of this option is not specified - it
is added automatically.
Before running the `ATTACH` it also runs:
```
INSTALL ducklake
LOAD ducklake
```
2. `ducklake_alias`: the `database-alias` parameter to pass to
`ATTACH '<database-path>' AS <database-alias>`.
This is to allow to override auto-detected DuckLake catalog name in
cases when `database-path` has long naming or include UUIDs.
After the connection is established it also runs `USE <database-alias>`.
Testing: test coverage is pending, DuckLake extension is not yet
available in the `main` branch.1 parent c732b72 commit 546c388
1 file changed
+64
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
8 | 4 | | |
| 5 | + | |
9 | 6 | | |
| 7 | + | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
48 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
49 | 62 | | |
50 | 63 | | |
51 | 64 | | |
52 | | - | |
| 65 | + | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
| |||
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
75 | 132 | | |
0 commit comments