Files
openidea/templates/theme-plugin
l0ng-ai 575749f2ac feat(database): Add query plans, history, data tools and schema objects (#63)
New query, data and schema tools for the Database feature (SQLite, PostgreSQL, MySQL).

## Query console
- **Explain Plan** tab: SQLite `EXPLAIN QUERY PLAN`, PostgreSQL `EXPLAIN (FORMAT JSON)`, MySQL `EXPLAIN`, parsed in `ide-db::plan` into an operation tree (Full Scan / Index Scan / Group By / Order By …) under a statement root, with a properties panel.
- **Query history**: `ide-db::history` keeps executed statements per project and source in `db-history.json` (deduplicated, newest first, 500 max). The Browse Query History dialog has search, a highlighted preview, Paste and Delete.
- Output reports `(execution: X ms, fetching: Y ms)`.

## Results and table editor
- Local column filter (value list with counts) and local sort.
- Record / Value / Aggregates side panel.
- Chart view (bar / line) with X / Y / aggregation settings.
- Export Data dialog: extractor, Transpose, headers, preview, file or clipboard. An extractor drop-down sits on the data toolbars.
- Import Data from a CSV / TSV file.
- Table editor gets a WHERE | ORDER BY row. Column headers fit their names, with filter and sort indicators. Whole SQLite REALs display as `3108`, not `3108.0`.

## Database tree
- Triggers under tables. Routines, sequences and materialized views under schemas, with DDL, Quick Documentation and Drop.
- Data source options: object filter, show template databases, single database mode (PostgreSQL).
- New ▸ Import from Clipboard (connection URLs).

## IPC
New commands: `db_schema_objects`, `db_object_ddl`, `db_explain`, `db_history`, `db_remove_history`. Bindings are regenerated.

## Testing
- `cargo test -p ide-db`: plan parsing, history store, trigger listing and DDL, explain without executing.
- `cargo clippy -p ide-db -p openidea --all-targets -- -D warnings` is clean.
- `pnpm typecheck` and eslint pass. `pnpm vitest run src/features/database src/ui`: 226 passed.
- Checked in the running app against a SQLite database:
  - tree with triggers
  - result grid, local filter, side panel
  - chart
  - Explain Plan
  - history dialog
  - Export Data dialog
  - table editor ORDER BY
  - CSV import




Merge follow-up: grouped the new `--chart-series` token under a section comment and added it to the theme plugin template (theme.test.ts on main), regenerated docs/plugins/themes.md. Re-verified after merging main on macOS with a SQLite source: query + result grid with filter/sort headers, Explain Plan tab (Full Scan / Index Scan / Group By / Order By), Query History dialog; `cargo nextest run -p ide-db` 45 passed, bindings unchanged after regeneration.

https://claude.ai/code/session_01VUYsdXA2nkF5v6zsC93dpn
2026-10-27 13:31:29 +08:00
..

Theme plugin template

A complete OpenIDEA theme plugin with one worked example, Harbor Night: a dark theme with slate surfaces, a teal accent and a warm syntax palette. Copy this folder to start your own theme. Full documentation, the token reference and porting guides are in docs/plugins/themes.md.

theme-plugin/
├─ plugin.toml                          # manifest: id, name, version, the theme files
└─ themes/
   ├─ harbor-night.theme.json           # UI colours, every themeable token, grouped like tokens.css
   └─ harbor-night.scheme.json          # editor colour scheme: syntax, editor, ANSI colours

A theme plugin is data only: no code, no WebAssembly, no build step.

Make your own

  1. Copy the folder, for example to ~/openidea-themes/theme-my-theme.
  2. In plugin.toml, change id (lowercase, a-z 0-9 - _), name, description, authors and the two paths.
  3. Rename the theme files. In the theme file, set id, name and kind ("dark" or "light", the built-in base for anything you leave out).
  4. Edit the colours. Each key is a CSS variable from src/styles/tokens.css, and the reference in the docs gives the Islands Dark and Light values. Comments (//, /* */) are allowed. Delete a line to keep the built-in value.

Porting an IntelliJ theme? pnpm theme:import-intellij <file.theme.json> [file.icls] --out <dir> in the OpenIDEA repository generates a package in this layout.

Package and install

The folder is the package. To share it, publish the folder as a Git repository or a zip that users extract.

  1. In OpenIDEA open Settings › Plugins, click the gear menu and choose Install Plugin from Disk… (or run the Install Plugin from Disk… action), then pick the folder that contains plugin.toml.
  2. Select the plugin in the Installed tab and press Apply next to the theme.
  3. Use Default Theme in the same place goes back to the built-in theme.

Iterate

Put (or symlink) the folder in <project>/.openidea/plugins/ of an open project. It loads as a dev plugin, and Reload in Settings › Plugins (or the Reload Plugins action) re-reads your edits without reinstalling. Invalid JSON or values are reported in Settings › Plugins with the file and line.

Licence

The template and Harbor Night are part of OpenIDEA (Apache-2.0). When you port someone else's theme, keep its licence and credit its authors.