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

SQL Complete scheme

Compare two types before and after formatting

The dbForge SQL Complete tool helps avoid this situation and assists developers in ensuring that the update scripts will be sent to the NuGet package formatted in accordance with the standards.

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
Watch video
Conclusion

Conclusion

dbForge SQL Complete is a universal tool with advanced IntelliSense-style capabilities and rich formatting options that helps developers in the process of code writing and formatting. It can be used to format scripts or folders with scripts before embedding them in a NuGet package. You can significantly save time by automating formatting processes with SQL Complete and the Invoke-DevartFormatScript PowerShell cmdlet.

Learn about other dbForge tools involved in collaborative
database development and deployment