Esat Erkec
SQL developer productivity dashboard

Five beneficial Azure Data Studio Extensions for SQL developers

July 19, 2022 by

This article will mention five helpful Azure Data Studio extensions that may help to improve the SQL developers’ productivity.

Introduction

SQL developers make an effort on query coding more than database administrators. One of the main responsibilities of SQL developers is to write complex queries and they also deal to create and alter the stored procedures, views, and triggers. In this context, the development environment usability and ease of adaption to new features gain more importance for SQL developers. We started using SQL Server Management Studio (SSMS) with SQL Server 2005 and we are still using it with great enjoyment. However, Azure Data Studio entered the game about two years ago and became a second database development platform option for SQL developers.

Azure Data Studio (ADS) is a new generation database administration, development, and maintenance platform that can be used for on-premises and cloud data platforms. One of the appealing features of Azure Data Studio is that it gains various new functionalities by adding extensions to it. In the next sections of this article, we will shortly look at the following extensions that can supply comfort in our database development works:

  • Atom One Dark Theme
  • SQL Server Profiler
  • WakaTime
  • Query History
  • Visual Studio IntelliCode

Atom One Dark Theme extension

Azure Data Studio includes a dark theme in its default installation. We can enable the default dark theme by the way of the different methods:

  • Expand the File menu and then choose the Color Theme option under the Preferences menu item.

    Color Theme settings in Azure Data Studio

  • Click the Manage button and then choose the Color Theme option.

    Color theme option in manage

  • Open the command palette (Ctrl+Shift+P) and find the Color Theme option.

    Set color theme in the command palette

After clicking Color Theme, the theme options will be listed and we can set the Azure Data Studio theme which we like.

Color theme list in ADS

Atom One Dark Theme is an alternative option to the default themes. Firstly, we find the Atom One Dark Theme extension from the marketplace and click the Install button where is located in the lower right corner.

Atom One Dark Theme extension

We select the vsix file of the extension and download it from the Github repository.

Tip:  A vsix file is an installable form of the Visual Studio extensions that are used to install the extensions into the Visual Studio and Visual Studio Code. We can explore and download the extensions in the Visual Studio marketplace.

Download Atom One Dark Theme download

In order to install the atom one dark theme, we press the Ctrl+Shift+P key combination to open the command palette and find and then click the Install from VSIX… command.

Tip: We can launch the command palette to use the View menu of the Azure Data Studio.

Open command palette

Open command palette in view menu

At last, we will choose the downloaded VSIX file path and then enable the theme. After that, the Atom One theme will be added to the theme list.

Change theme in ADS

The appearance of our code will be like as below with the Atom theme.

Dark Theme appearance

SQL Server Profiler extension

The SQL Server extension is a query tracking and activity monitoring tool that is developed for Azure Data Studio. However, unlike the profiler word in its name, it uses XEvents. After installing the SQL Server profiler extension from the marketplace, we can create a new trace through the command palette.

Launch profiler

Profiler extension offers Standard_OnPrem and TSQL_OnPrem templates as default on-premises installations.

Select the default profilers

Standard_OnPrem captures the following events:

  1. Attention
  2. existing_connection
  3. login
  4. logout
  5. rpc_completed
  6. sql_batch_completed
  7. sql_batch_starting

TSQL_OnPrem captures the following events:

  1. existing_connection
  2. login
  3. logout
  4. rpc_starting
  5. sql_batch_starting

After starting a trace the captured data will be displayed event viewer window. In this window, we can filter the captured event data.

Event data list

The Select View option enables to change of the appearance of the profiler.

Profiler Select view

When we click the Details tab, we can see the clicked row event details.

SQL profiler details

WakaTime

WakaTime is a productivity tracking tool that analyzes and monitors how much time a developer spent time with coding. The Wakatime supports numerous IDE and we can also install it into the Azure Data Studio.

Wakatime extension

At first, we will download and install the Wakatime extension from the marketplace, and then we need the restart the Azure Data Studio. As the next step, we enter an API Key to integrate ADS and Wakatime to enable the tracking of our coding activity. We can find the API Key under the Setting page of the Wakatime portal.

Tip: If you don’t have a Wakatime account, you can easily generate it with your GitHub account or can create an individual account.

Wakatime account setting

We find WakaTime: Api Key settings in the command palette and enter the API Key.

How to enter API Key

After spending some time with coding, our activities will be tracked by Wakatime and we can monitor these activities with a dashboard. We find the Wakatime: Open Dashboard command and click it.

SQL developer productivity dashboard

Poor SQL Formatter

There are various best practices for writing readable code. For example, the following best practices may help to improve our queries code readability:

  • Adding clear and short explanations into the queries
  • As possible as to apply the DRY (Don’t Repeat Your Self) principle
  • Use meaningful and long enough variable names

Along with all these best practices, a well-organized and nice look definitely helps with code readability. Poor SQL Formater is a T-SQL query beautifier tool that helps to re-form more readable and pleasant to look at. We re-format the T-SQL queries to execute the Poor SQL: Format T-SQL command in the command palette.

Use SQL formatter

For example, the code above will be formatted as follows with Poor SQL formatter.

Poor SQL Formatter

We can assign a shortcut key combination to make this query formatting easier to run. On the command palette, we find the Poor SQL: Format T-SQL and then click the Configure Keybinding button where is located on the right side of the command palette.

Assigning a shortcut key combination

In the configuration window, we double-click on the Keybinding column and then we press the key combination which we want to assign as a shortcut for the Poor SQL formatter.

Keybinding option

Query History

Query History extension captures and stores the past executed queries and then enables to show them through a panel. After installing the query history, we can enable the query history panel to use the View menu of the Azure Data Studio.

Query history extension

When we execute any query, the Query Store begins to store the executed queries and display the previously executed queries in a panel.

Query history panel

In this panel, we can find the different information about the executed query :

Status icon: This icon shows the status of the last executed query. The green check sign shows the query is completed successfully. The red cross symbol specifies the executed query encountered an error during its execution.

Query Text: This column shows the text of the executed query and also when we right-click on this tab open, run and delete the selected query in a separate window.

Query history menu

The Clear All History menu item clears all historical query and the Pause Query History Capture stops capturing the executed queries temporarily.

Visual Studio IntelliCode

Visual Studio IntelliCode is a code completion tool that is assisted with machine learning (ML) algorithms to predict code completions. The main benefit of this IntelliCode improving the productivity of the developer. The code completion recommendations are developed based on open-source projects on GitHub so that the code completion predictions are closer to coding practices rather than alphabetical or most-recently-used lists.IntelliCode supports the following programming languages:

C#, C++, Visual Basics, XAML, JavaScript, TypeScript, Java, Python, SQL.

After installing the Visual Studio IntelliCode extension of the Azure Data Studio the IntelliCode code completion recommendations will be enabled. For example, the default code recommendation of the ADS offers a WHEN syntax after the table name of the select statement.

Default code completion

However, IntelliCode offers a WHERE clause and it is more reasonable because we almost always use a WHERE or JOIN clause after a table name.

IntelliCode code completion

Summary

In this article, we explored some beneficial Azure Data Studio extensions that help to improve the productivity of the query coding process.

Esat Erkec
715 Views