Skip to content

Instantly share code, notes, and snippets.

@filimonov
Last active April 7, 2025 08:57
Show Gist options
  • Save filimonov/691990c8e5ce901ca4734482c7cc81f9 to your computer and use it in GitHub Desktop.
Save filimonov/691990c8e5ce901ca4734482c7cc81f9 to your computer and use it in GitHub Desktop.
vscode + clickhouse-client: poorman integration
  1. File->Preferences->Settings terminal.integrated.scrollback, Increase the buffer size for terminal (i use 100000)

  2. File->Prefernces->Keyboard shortcuts workbench.action.terminal.runSelectedText set up some binding like Ctrl+Shift+'

  3. Open terminal window: Terminal->New Terminal

  4. Run clickhouse-client in a terminal.

  5. Highlight the query & hit the shortcut (or use Terminal->Run Selected Text)

Result: Screenshot from 2020-04-02 13-26-47

@hiepxanh
Copy link

hiepxanh commented Jul 6, 2021

perfect useful

@restyler
Copy link

great approach for minimalists, thanks!

@brabeji
Copy link

brabeji commented Feb 27, 2025

Great idea, some possible improvements:

Run query at cursor

Assuming blank lines between queries (prettier-plugin-sql seems to work fine), try this keybinding to run the query at current cursor position:

  {
    "key": "cmd+enter",
    "command": "runCommands",
    "when": "editorTextFocus && editorLangId == 'sql'",
    "args": {
      "commands": [
        { "command": "cursorMove", "args": { "to": "prevBlankLine" } },
        {
          "command": "cursorMove",
          "args": { "to": "nextBlankLine", "select": true }
        },
        { "command": "workbench.action.terminal.runSelectedText" }
      ]
    }
  }

Disable wide tables wrapping

alt+z in terminal disables wrapping

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