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 PostGreSQL.

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.67.1
  • Windows Server 2019
  • Vertica Analytical Database 11.1.1

Installing Visual Studio Code

Download VS Code from the Visual Studio website,

Connecting Visual Studio Code to Vertica

  1. Open the VS Code editor and click Extensions.

  2. Ensure you download the following extensions:
    SQL Tools

    SQLTools PostgreSQL/Redshift Drivers

  3. Click Install to install both the extensions.
  4. Click SQLTools.
  5. Click Add new connection.
  6. Select and click PostgreSQL.
  7. Enter the Vertica database connection details:
  8. Click TEST CONNECTION. If you are connected, the Successfully connected message appears.
  10. 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