An intentionally small Eclipse/OSGi starting point for a DBeaver SQL Editor
plugin. It registers a class with DBeaver's public
org.jkiss.dbeaver.sql.editorAddIns extension point and supplies only bundle
and editor lifecycle scaffolding.
This is a template, not an SQL feature implementation. It contains no LSP server, SQL parsing or analysis, indexing, diagnostics, MCP integration, database access, or workspace scanning.
- Java 21
- A local DBeaver installation when compiling or installing the plugin
curl,zip, and a POSIX-compatible shell
Set DBEAVER_HOME to the Eclipse directory inside your DBeaver installation
and, if necessary, DBEAVER_JAVA to its Java 21 executable. On macOS, a
typical setup is:
export DBEAVER_HOME=/Applications/DBeaver.app/Contents/Eclipse
export DBEAVER_JAVA=/path/to/java-21/bin/javaOn Linux and Windows installations, point those variables at the equivalent
directories/files. DBEAVER_JAVA must be Java 21 (it may be a separate JDK
when the DBeaver-bundled runtime is newer). build-local.sh can fall back to
java on PATH, but it still requires DBEAVER_HOME/plugins for DBeaver's
compile classpath.
./build-local.sh
./install-local.sh
./uninstall-local.shThe build script compiles with ECJ and produces a bundle JAR in the temporary
directory named by DBEAVER_PLUGIN_BUILD_DIR (default:
$TMPDIR/dbeaver-plugin-template-build). The installer publishes that JAR to a
temporary p2 repository and installs it through the Equinox p2 director.
Restart DBeaver with -clean if the new extension is not discovered.
uninstall-local.sh removes the installed bundle through the same p2 director;
it does not delete any unrelated DBeaver plugins.
BUNDLE_SYMBOLIC_NAME and BUNDLE_VERSION change the built artifact and p2
installable unit. Normally they should match the values you put in the
manifest.
build-local.sh downloads a pinned ECJ compiler from Maven Central. It does
not need LSP4J or JSON-RPC for this template because the template has no LSP
implementation or LSP bundle requirement. If you are extending the template
with an LSP client, set DBEAVER_DOWNLOAD_LSP4J=true to cache the pinned
LSP4J and JSON-RPC JARs beside ECJ. That opt-in only downloads the artifacts;
you must deliberately add the appropriate OSGi requirements and code.
The versions are constants in build-local.sh, so local builds and CI do not
silently float Maven dependency versions. Downloads are cached in
DBEAVER_PLUGIN_DEPS_DIR or $TMPDIR/dbeaver-plugin-template-deps.
The defaults are deliberately generic:
- Java package:
org.example.dbeaver - bundle symbolic name:
org.example.dbeaver - activator:
org.example.dbeaver.Activator - editor add-in:
org.example.dbeaver.ui.TemplateSqlEditorAddIn
To rename them, move the Java source directories and update the package
statements, then make the same coordinated changes in:
META-INF/MANIFEST.MF:Bundle-SymbolicName,Bundle-Activator, andAutomatic-Module-Name.plugin.xml: the add-inclassandid.Activator.PLUGIN_ID.- Any
BUNDLE_SYMBOLIC_NAMEvalue used for local build/install commands.
Keep the extension point unchanged unless you intentionally target a different
DBeaver extension API. TemplateSqlEditorAddIn is the hook that DBeaver calls
for each SQL editor; add editor-scoped setup in init and release resources in
cleanup.
Run the standalone checks with:
./validate.shThey validate the manifest and plugin.xml, check shell syntax, and reject
references to unrelated product code. With DBEAVER_HOME pointing to a real
installation, the same script runs an ECJ build smoke test against the actual
DBeaver plugin JARs. Without DBeaver it reports that integration check as
skipped and exits successfully; a failed requested build is never masked.
DBeaver's public extension point is stable enough for a template, but the concrete DBeaver JAR set is versioned with each distribution. Always run the local build and exercise the plugin in the exact DBeaver version you plan to support. CI deliberately cannot claim integration coverage when it has no DBeaver installation.
The included code neither reads SQL documents nor connects to a database. It does not inspect the workspace, index files, invoke external tools, or access passwords or connection credentials. Features you add later may change that security posture; document and review their permissions separately.
See CONTRIBUTING.md. The project is licensed under Apache-2.0. Release notes are in CHANGELOG.md.