Vertica and Visual Studio Code: Technical Exploration

About this Document

The goal of this exploration is to integrate Visual Studio Code (VS Code) with Vertica. VS Code provides a platform to create connection to databases, query them, and view results. The code in VS Code can be customized and enhanced through the Extension APIs. To connect VS Code and Vertica, you need to install the extensions, SQL Tools, and SQL Tools Vertica driver.

Visual Studio Code Overview

Visual Studio Code is an open-source platform used for code editing and debugging, syntax highlighting, and code compilation. You can connect to a container running a different OS and use any VS Code plugin for that environment. It includes IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.

Test Environment

  • Visual Studio Code 1.84.0
  • Windows Server 2019
  • Vertica Analytical Database 23.4.0

Installing Visual Studio Code

Download VS Code from the Visual Studio website, https://code.visualstudio.com/download.

Connecting Visual Studio Code to Vertica

  1. Open VS Code editor and click Extensions.

  2. Ensure you download the following extensions:
    SQL Tools

    SQLTools Vertica Driver

  3. Click Install to install both the extensions.
  4. Click SQLTools.
  5. Click Add new connection.
  6. Select Vertica.
  7. Enter the Vertica database connection details:

  8. Click TEST CONNECTION. If you are connected, the Successfully connected message appears.
  9. Click SAVE CONNECTION.
  10. Review your connection details and click CONNECT NOW.
  11. The Vertica connection details are displayed in the top left pane.
  12. Click New Sql File.
  13. Type the query for the Vertica database.
  14. Click Run for the active connection.
  15. The following output screen is displayed:

For More Information