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

A data source can now be made global with the Global option in its properties. Global data sources are stored in data-sources.toml in the app data directory and listed in every project's Database tool window, marked "global". Project data sources stay in .openidea/data-sources.toml, and a project one wins over a global one with the same id.

Saved passwords of global data sources are kept under an app-wide key in the existing saved-password file, so every project uses them; making a data source global or project-level moves its saved passwords along. The global file is only rewritten when the global data sources change, so a save in one project doesn't overwrite another project's edit.

Fixes #1252
Цей коміт міститься в:
l0ng-ai committed 2026-11-05 09:24:00 +08:00
1 джерело a247f1ce67
коміт 1852122fdf
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": "选择服务器可执行文件",