TigerQuery

TigerQuery is a lightweight .NET library and command-line toolkit for executing SQL Server scripts with familiar sqlcmd-style behaviour.

It is designed for applications, automation tools, and developers who need reliable SQL script parsing and execution without depending on the original sqlcmd executable.

TigerQuery supports common SQL script features such as:

  • GO batch separators, including repeat counts
  • sqlcmd variables such as $(VariableName)
  • :setvar
  • :on error
  • script execution from files or strings
  • asynchronous batch execution
  • execution messages and result-set callbacks
  • structured execution results and exit codes
  • SQL Server connection-profile management
  • interactive and non-interactive command-line usage

Project structure

TigerQuery is divided into several focused packages.

ItTiger.TigerQuery

The main SQL script engine and parser.

This package contains the core functionality for parsing and executing SQL scripts with behaviour compatible with common sqlcmd and SQL Server Management Studio scripting conventions.

It can be embedded directly into .NET applications and does not depend on console-specific output.

ItTiger.TigerQuery.Core

Reusable support for named SQL Server connection profiles.

It provides functionality for storing, validating, resolving, and protecting connection settings, including support for secure password storage on supported platforms.

ItTiger.TigerQuery.CliCore

Reusable TigerCli-based commands for managing SQL Server connection profiles.

It is intended for command-line applications built on TigerCli, including tools such as tiger-sqlcmd and tiger-wrap.

tiger-sqlcmd

tiger-sqlcmd is the ready-to-use command-line application built on TigerQuery and TigerCli.

It provides script execution, saved connection management, interactive prompts, structured output, localisation, and automation-friendly non-interactive behaviour.

Designed for embedding

TigerQuery separates SQL execution from presentation.

Applications can receive messages, errors, batch results, and result sets through callbacks and render them in any suitable form, including:

  • command-line output
  • desktop applications
  • web applications
  • automated deployment tools
  • test frameworks
  • CI/CD pipelines

This design keeps the engine reusable and avoids coupling it to a particular console or user-interface framework.

TigerCli integration

The TigerQuery command-line components use TigerCli for:

  • command and option parsing
  • interactive prompts
  • non-interactive execution
  • semantic styling
  • localisation
  • structured tables and details
  • consistent help and version output
  • application-level testing

TigerCli allows TigerQuery-based tools to provide a rich interactive experience while remaining safe and predictable in scripts and automated environments.

Use cases

TigerQuery is suitable for:

  • database deployment utilities
  • migration and provisioning tools
  • SQL Server administration scripts
  • CI/CD database steps
  • custom developer tools
  • applications that need embedded sqlcmd-style script execution
  • command-line tools that share named SQL Server connections

Current release

The current TigerQuery release is version 0.8.1.

The project is under active development. The public APIs and package structure are becoming stable, but changes may still occur before version 1.0.

Source code

TigerQuery is open source and available on GitHub:

https://github.com/rkozlowski/TigerQuery

NuGet packages

TigerQuery is distributed through NuGet as:

  • ItTiger.TigerQuery
  • ItTiger.TigerQuery.Core
  • ItTiger.TigerQuery.CliCore

License

TigerQuery is released under the MIT License.