Skip to content

Capabilities

A plugin's capabilities are declared in the capabilities section of its manifest:

  • views are the views your plugin provides, such as a tab.
  • menu is the menu items and buttons that open those views, and where they appear in Beekeeper Studio.

This page lists every place a menu item can appear. Picking the item opens one of your plugin's views in a new tab, and the view can read where it was opened from with getViewContext().

Menu items are declared in the capabilities.menu array:

{
  "capabilities": {
    "views": [
      { "id": "overview", "name": "Table Overview", "type": "base-tab", "entry": "index.html" }
    ],
    "menu": [
      {
        "command": "profile-table",
        "name": "Profile Table",
        "view": "overview",
        "placement": ["entity.table.context", "tab.table.header.context"],
        "icon": "query_stats"
      }
    ]
  }
}
  • command identifies the item. It must be unique within a placement.
  • name is the label users see.
  • view is the id of the view to open.
  • placement is where the item appears: one placement, or an array of them to show the same item in several places.
  • icon is a Material icon name. It falls back to the manifest's icon.

See PluginMenuItem for every field, including enabledWhen.

In context menus, items from all plugins share one Plugins section at the bottom of the menu. Plugins are sorted by name, each plugin's items keep their manifest order, and the section ends with Manage Plugins….

Beekeeper Studio 6.2

editor.query.toolbar, results.statusbar, tableTable.statusbar, tab.query.header.context and tab.table.header.context need Beekeeper Studio 6.2 or later. Earlier versions skip items with a placement they don't know. Set "minAppVersion": "6.2.0" in your manifest if your plugin depends on them.

All Menu Placements

Placement Where it appears View params
newTabDropdown Dropdown next to the new tab button None
menubar.tools Tools menu None
editor.query.context Query editor context menu EditorMenuParams
editor.query.toolbar Query editor toolbar, next to Run EditorMenuParams
results.cell.context Query results: cell context menu CellMenuParams
results.columnHeader.context Query results: column header context menu ColumnMenuParams
results.rowHeader.context Query results: row header context menu RowMenuParams
results.corner.context Query results: top left corner context menu CornerMenuParams
results.statusbar Query results: Visualize menu StatusbarMenuParams
tableTable.cell.context Table view: cell context menu CellMenuParams
tableTable.columnHeader.context Table view: column header context menu ColumnMenuParams
tableTable.rowHeader.context Table view: row header context menu RowMenuParams
tableTable.corner.context Table view: top left corner context menu CornerMenuParams
tableTable.statusbar Table view: Visualize menu StatusbarMenuParams
tab.query.header.context Query tab header context menu TabMenuParams
tab.table.header.context Table tab header context menu TabMenuParams
entity.table.context Sidebar: table context menu EntityMenuParams
entity.schema.context Sidebar: schema context menu EntityMenuParams
entity.routine.context Sidebar: routine context menu EntityMenuParams
structure.statusbar.menu Table structure view: actions menu EntityMenuParams

The view params are what getViewContext() returns in params. See Menu item params for details.

App Menus

New Tab Dropdown

newTabDropdown adds an item to the dropdown next to the + new tab button. Use it for views that don't need anything selected first.

The new tab dropdown with a Table Overview item

{
  "command": "table-overview",
  "name": "Table Overview",
  "view": "overview",
  "placement": "newTabDropdown",
  "icon": "dashboard"
}

Tools Menu

menubar.tools adds an item to the Tools menu in the menu bar.

The Tools menu with a Table Overview item

{
  "command": "table-overview",
  "name": "Table Overview",
  "view": "overview",
  "placement": "menubar.tools"
}

Query Editor

Query Editor Context Menu

editor.query.context adds an item to the context menu of the query editor. The view receives the editor's text, the selected text and the statement under the cursor.

The query editor context menu with an Explain Query item

{
  "command": "explain-query",
  "name": "Explain Query",
  "view": "explain",
  "placement": "editor.query.context",
  "icon": "account_tree"
}

Query Editor Toolbar

editor.query.toolbar adds a button to the query editor toolbar, next to Run. The button shows the item's icon and its whole name, so keep the name short: names longer than 20 characters log a warning to the developer console.

An Explain button in the query editor toolbar

{
  "command": "explain",
  "name": "Explain",
  "view": "explain",
  "placement": "editor.query.toolbar",
  "icon": "account_tree"
}

Query Results

The results grid below the query editor has a context menu on its cells, column headers, row headers and top left corner, plus a Visualize menu in the status bar.

Query Results Cell

results.cell.context adds an item to the context menu of a result cell.

A result cell's context menu with an Inspect Value item

{
  "command": "inspect-value",
  "name": "Inspect Value",
  "view": "inspector",
  "placement": "results.cell.context",
  "icon": "data_object"
}

Query Results Column Header

results.columnHeader.context adds an item to the context menu of a result column header.

A result column header's context menu with a Profile Column item

{
  "command": "profile-column",
  "name": "Profile Column",
  "view": "profiler",
  "placement": "results.columnHeader.context",
  "icon": "query_stats"
}

Query Results Row Header

results.rowHeader.context adds an item to the context menu of a result row number.

A result row header's context menu with an Inspect Row item

{
  "command": "inspect-row",
  "name": "Inspect Row",
  "view": "inspector",
  "placement": "results.rowHeader.context",
  "icon": "view_agenda"
}

Query Results Corner

results.corner.context adds an item to the context menu of the top left corner of the results grid, which acts on the whole result.

The results grid corner context menu with a Summarize Rows item

{
  "command": "summarize",
  "name": "Summarize Rows",
  "view": "summary",
  "placement": "results.corner.context",
  "icon": "summarize"
}

Query Results Visualize Menu

results.statusbar adds an item to the Visualize menu in the query results status bar. The view receives the selected cells, or the whole result when nothing is selected. Use enabledWhen to keep the item disabled until the result suits it. See Status bar params.

The Visualize menu in the query results status bar with a Chart item

{
  "command": "chart",
  "name": "Chart",
  "view": "chart",
  "placement": "results.statusbar",
  "icon": "bar_chart"
}

Table View

The table view (opened with View Data) has the same grid menus as the query results, with their own placements, so a plugin can choose to appear in either or both.

Table View Cell

tableTable.cell.context adds an item to the context menu of a table cell.

A table view cell's context menu with an Inspect Value item

{
  "command": "inspect-value",
  "name": "Inspect Value",
  "view": "inspector",
  "placement": "tableTable.cell.context",
  "icon": "data_object"
}

Table View Column Header

tableTable.columnHeader.context adds an item to the context menu of a table column header.

A table view column header's context menu with a Profile Column item

{
  "command": "profile-column",
  "name": "Profile Column",
  "view": "profiler",
  "placement": "tableTable.columnHeader.context",
  "icon": "query_stats"
}

Table View Row Header

tableTable.rowHeader.context adds an item to the context menu of a table row number.

A table view row header's context menu with an Inspect Row item

{
  "command": "inspect-row",
  "name": "Inspect Row",
  "view": "inspector",
  "placement": "tableTable.rowHeader.context",
  "icon": "view_agenda"
}

Table View Corner

tableTable.corner.context adds an item to the context menu of the top left corner of the table view.

The table view corner context menu with a Summarize Rows item

{
  "command": "summarize",
  "name": "Summarize Rows",
  "view": "summary",
  "placement": "tableTable.corner.context",
  "icon": "summarize"
}

Table View Visualize Menu

tableTable.statusbar adds an item to the Visualize menu in the table view status bar. With nothing selected, the view receives the table and its filters instead of rows. See Status bar params.

The Visualize menu in the table view status bar with a Chart item

{
  "command": "chart",
  "name": "Chart",
  "view": "chart",
  "placement": "tableTable.statusbar",
  "icon": "bar_chart"
}

To show the same item in both Visualize menus, list both placements: "placement": ["results.statusbar", "tableTable.statusbar"].

Tabs

Query Tab Header

tab.query.header.context adds an item to the context menu of a query tab's header.

A query tab header's context menu with a Share Query item

{
  "command": "share-query",
  "name": "Share Query",
  "view": "share",
  "placement": "tab.query.header.context",
  "icon": "share"
}

Table Tab Header

tab.table.header.context adds an item to the context menu of a table tab's header.

A table tab header's context menu with a Profile Table item

{
  "command": "profile-table",
  "name": "Profile Table",
  "view": "profiler",
  "placement": "tab.table.header.context",
  "icon": "query_stats"
}

The entity list in the sidebar has a context menu for each kind of entity. Schemas and routines only appear for databases that have them, such as PostgreSQL.

entity.table.context adds an item to the context menu of a table in the sidebar.

A table's context menu in the sidebar with a Profile Table item

{
  "command": "profile-table",
  "name": "Profile Table",
  "view": "profiler",
  "placement": "entity.table.context",
  "icon": "query_stats"
}

entity.schema.context adds an item to the context menu of a schema in the sidebar.

A schema's context menu in the sidebar with a Schema Overview item

{
  "command": "schema-overview",
  "name": "Schema Overview",
  "view": "overview",
  "placement": "entity.schema.context",
  "icon": "schema"
}

entity.routine.context adds an item to the context menu of a function or stored procedure in the sidebar.

A routine's context menu in the sidebar with a Document Function item

{
  "command": "document-function",
  "name": "Document Function",
  "view": "docs",
  "placement": "entity.routine.context",
  "icon": "functions"
}

Table Structure

Table Structure Actions Menu

structure.statusbar.menu adds an item to the actions menu (the gear button) in the status bar of the table structure view.

The table structure actions menu with a Generate Docs item

{
  "command": "generate-docs",
  "name": "Generate Docs",
  "view": "docs",
  "placement": "structure.statusbar.menu",
  "icon": "description"
}

Next Steps