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.
- 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, https://code.visualstudio.com/download.
Connecting Visual Studio Code to Vertica
- Open the VS Code editor and click Extensions.
- Ensure you download the following extensions:
SQLTools PostgreSQL/Redshift Drivers
- Click Install to install both the extensions.
- Click SQLTools.
- Click Add new connection.
- Select and click PostgreSQL.
- Enter the Vertica database connection details:
- Click TEST CONNECTION. If you are connected, the Successfully connected message appears.
- Click SAVE CONNECTION.
- Click CONNECT NOW.
- The Vertica connection details are displayed in the top left pane.
- Click New Sql File.
- Type the query for the Vertica database.
- Click Run for the active connection.
- The following output screen is displayed: