feat(database): join tables across saved data sources in a query workspace (#6265)

Query Workspace, opened from the Database tree, runs a single SELECT joining two to eight tables from saved PostgreSQL, ClickHouse, SQLite and file-backed DuckDB sources. Typing # picks a saved source without connecting; table and key completion fetch that source's metadata, and optional aliases disambiguate duplicate names. The project host reads the projected columns and join keys on independent read-only connections, complete or failing, within per-input and total row/byte limits, and joins them in the installed DuckDB JDBC driver. Run executes the statement at the caret or the selected statements in order and Execute Script runs the editor; each statement keeps its timing, result tab and page, and Stop or the first error ends the batch.

Closes #6177

Co-authored-by: principalwater <[email protected]>
Цей коміт міститься в:
Vladislav Kuzmin authored and GitHub committed 2026-11-29 16:14:39 +08:00
1 джерело 5a92145ad9
коміт 5cbc4134a1
34 files changed
+5862 -570

No files matched your search

+140
Переглянути файл
@@ -0,0 +1,140 @@
.workspace {
display: flex;
height: 100%;
min-height: 0;
flex-direction: column;
background: var(--bg-editor);
}
.toolbar,
.firstRunActions,
.running,
.settingsActions {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-2);
}
.toolbar {
flex: none;
padding: var(--space-1) var(--space-2);
border-bottom: 1px solid var(--border);
gap: var(--space-0-5);
}
.context {
min-width: 0;
max-width: calc(100% - 32px);
margin-inline-start: auto;
}
.context > span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.firstRun,
.running {
color: var(--fg-muted);
}
.running {
margin-inline-start: var(--space-2);
}
.settings [role="alert"] {
color: var(--danger);
}
.settings {
display: flex;
flex-direction: column;
gap: var(--space-3);
padding: var(--space-3) var(--space-4);
}
.settings p {
margin: 0;
color: var(--fg-muted);
}
.driverMode {
margin-inline-start: var(--space-2);
color: var(--fg-muted);
}
.aliasFields {
display: grid;
gap: var(--space-2);
max-height: 260px;
overflow: auto;
padding: var(--space-2) var(--space-1) var(--space-1) 0;
}
.aliasField {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
align-items: center;
gap: var(--space-2);
}
.aliasName {
display: flex;
gap: var(--space-1-5);
align-items: center;
}
.aliasName > span,
.aliasName small {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.aliasName small {
display: block;
color: var(--fg-muted);
}
.field {
display: grid;
gap: var(--space-1);
min-width: 0;
}
.query {
position: relative;
flex: 1;
min-height: 90px;
overflow: hidden;
}
.editor {
height: 100%;
}
.firstRun {
position: absolute;
inset-block-start: 42px;
inset-inline-start: 44px;
max-width: calc(100% - 54px);
padding: var(--space-3);
border: 1px solid var(--border);
border-radius: var(--radius-field, 6px);
background: var(--bg-island);
pointer-events: none;
}
.firstRunActions button {
pointer-events: auto;
}
.example {
margin: var(--space-2) 0;
color: var(--fg-editor);
font-family: var(--font-mono);
line-height: 1.45;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.exampleKeyword {
color: var(--syn-keyword);
}
.exampleName {
color: var(--syn-string);
}
.query[data-result] {
flex: 0 1 38%;
border-bottom: 1px solid var(--border);
}
.query :global(.cm-editor) {
height: 100%;
}
.results {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
overflow: hidden;
}