feat(database): global data sources listed in every project (#1407)

Data sources can be made global (Global option in their properties): stored in data-sources.toml of the app data directory, listed in every project, with their saved passwords under an app-wide key that moves along when the scope changes. Fixes #1252
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-05 09:24:23 +08:00
1 джерело 6d55eb4aa9
коміт de0f9d6ecd
8 files changed
+185 -31

No files matched your search

+5
Переглянути файл
@@ -2480,6 +2480,11 @@ export type DataSource = {
options?: DbOptions,
introspection?: DbIntrospection,
properties?: DbProperty[],
/**
* Stored app-wide and listed in every project. Implied by the file it is read from,
* so not written to it.
*/
global?: boolean,
};
/** System Settings › Date Formats (Git log, Local History, blame). */
+5
Переглянути файл
@@ -432,6 +432,11 @@ export function DatabaseView() {
</span>
)}
<span className={labelClass}>{label(n)}</span>
{n.kind === "source" && n.source.global && (
<span className={styles.treeDetail} title={tx("Available in all projects")}>
{tx("global")}
</span>
)}
{d && (
<span
className={
+4
Переглянути файл
@@ -1069,6 +1069,10 @@ export function SourceDialog({
</span>
)}
/>
{/* IDEA's Make Global: stored with the IDE and listed in every project. */}
<span title={tx("Available in all projects")}>
<Checkbox checked={!!s.global} onChange={(global) => set({ global })} label="Global" />
</span>
</div>
<span />
{showComment ? (
+2
Переглянути файл
@@ -4242,6 +4242,8 @@
"Root markers": "根标记",
"Initialization options": "初始化选项",
"Global": "全局",
"global": "全局",
"Available in all projects": "在所有项目中可用",
"This project": "此项目",
"Executable name or path": "可执行文件名或路径",
"Select the server executable": "选择服务器可执行文件",