Skip to content

Add PRQL to SQL context menus to PRQL editor title #41

Closed

Description

@RandomFractals

This change would add direct access to the prqlSqlOutputPanel.open command to the open PRQL editor title menu and vscode title bar context menu.

Required package.json changes to the extension contributes config:

...
    "commands": [
      {
        "command": "prqlSqlOutputPanel.open",
        "title": "Open SQL Output Panel",
        "category": "PRQL",
        "icon": "$(database)"
      }
    ],
    "menus": {
      "editor/title": [
        {
          "command": "prqlSqlOutputPanel.open",
          "when": "resourceFilename =~ /.*(.prql)/",
          "group": "navigation"
        }
      ],
      "editor/title/context": [
        {
          "command": "prqlSqlOutputPanel.open",
          "when": "resourceFilename =~ /.*\\.(prql)/",
          "group": "navigation"
        }
      ]
    }
...

We can use the standard vscode $(database} icon to expose Open SQL Output Panel command in the top right corner of editor panel as depicted below:

prql-to-sql-db-icon-context-menu

Activity

  1. max-sixty commented on Feb 3, 2023

    @max-sixty
    Member

    I think this would be great!

  2. RandomFractals commented on Feb 4, 2023

    @RandomFractals
    CollaboratorAuthor

    Closing this as it was merged into main branch as part of PR #40.

    We might consider changing prqlSqlOutputPanel.open command and editor title menu icon from $(database) to $(open-preview) and use the database icon later on for selection of database to connect to and run generated SQL.

    I'll expand more on it in #42.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions