дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 01:01:17 +02:00
DuckDB sources get DuckDB's SQL dialect (highlighting, completion, formatting and resolution) and the database tree lists attached catalogs with their schemas, tables and columns. The JDBC bridge gains a catalogs command and catalog-scoped schema and table metadata, matched by exact catalog and schema names; tables in another catalog open and page through the source session. DDL that attaches, detaches or changes a catalog refreshes the tree. Co-authored-by: principalwater <[email protected]>
22 рядки
786 B
TypeScript
22 рядки
786 B
TypeScript
import type { EditorInput } from "@/workbench/contributions";
|
|
|
|
export const TABLE_KIND = "db-table";
|
|
|
|
export interface TableRef {
|
|
id: string;
|
|
schema: string;
|
|
table: string;
|
|
catalog?: string;
|
|
}
|
|
|
|
export function tableTitle(input: EditorInput): string {
|
|
const { catalog, schema, table } = input.data as TableRef;
|
|
return catalog === undefined ? table : `${catalog}.${schema}.${table}`;
|
|
}
|
|
|
|
export function tableInput(id: string, schema: string, table: string, catalog?: string): EditorInput {
|
|
const data: TableRef = catalog === undefined ? { id, schema, table } : { id, schema, table, catalog };
|
|
const key = catalog === undefined ? `${id}:${schema}.${table}` : JSON.stringify([id, catalog, schema, table]);
|
|
return { kind: TABLE_KIND, key: `${TABLE_KIND}:${key}`, data };
|
|
}
|