How dbForge SQL Complete is involved in the DevOps process

The dbForge SQL Complete tool has many advanced features, to name a few, a powerful IntelliSense-style SQL completion, code refactoring, code formatting, and some other smart productivity functionality that is designed to be a helping hand in developing code in both, SQL Server Management Studio, and Visual Studio. In the automated CI process, SQL Complete serves as an auxiliary tool that provides the ability to format the database creation scripts or the database update scripts before they get into a NuGet package

When database development is in hot phase, developers often tend to forget about formating a script before sending the UPDATE scripts to source control (Git) or use different formatting tools with inconsistent settings. As a result, the script formatting in NuGet looks like a mess that has nothing in common with the corporate code formatting standards.

The dbForge SQL Complete tool helps avoid this situation and assists developers in ensuring that the update scripts will be send to the NuGet package formatted in accordance with the standards.
01
The image on the right displays the script to update the database before formatting.
02
Here is how the same script looks after formatting with the SQL Complete tool.

Script to use dbForge SQL Complete in PowerShell

The following is a PowerShell script invoking the Invoke-DevartFormatScript cmdlet, which initiates the SQL Complete tool formatting functionality. As you can see from the script, the cmdlet input requires only one parameter: a path to the folder where the scripts to create or update the database schema are located.

# A script folder
$scriptFolder = "C:\Test\ScriptsFolder"

# Format scripts
Write-Host "Formatting a script folder..."
$result = Invoke-DevartFormatScript -Source $scriptFolder

Conclusion

dbForge SQL Complete is a universal tool that helps developers in the process of code writing and formatting. Thus, the tool significantly saves time on these processes.