ItTiger.TigerQuery 0.8.1

dotnet add package ItTiger.TigerQuery --version 0.8.1
                    
NuGet\Install-Package ItTiger.TigerQuery -Version 0.8.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ItTiger.TigerQuery" Version="0.8.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ItTiger.TigerQuery" Version="0.8.1" />
                    
Directory.Packages.props
<PackageReference Include="ItTiger.TigerQuery" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ItTiger.TigerQuery --version 0.8.1
                    
#r "nuget: ItTiger.TigerQuery, 0.8.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ItTiger.TigerQuery@0.8.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ItTiger.TigerQuery&version=0.8.1
                    
Install as a Cake Addin
#tool nuget:?package=ItTiger.TigerQuery&version=0.8.1
                    
Install as a Cake Tool

ItTiger.TigerQuery

TigerQuery is a standalone SQL Server script parser and execution engine for .NET with familiar sqlcmd / SSMS SqlCmd-mode behavior — a deliberate, test-driven reimplementation that is compatible where it matters and safer where it should be.

It is a library: it renders nothing and owns no console. Embed it in your own tools, services, or CLIs. (The ready-made tiger-sqlcmd CLI is built on it — see below.)

Capabilities

  • GO batch separators, including repeat counts (GO 5)
  • sqlcmd variables ($(name)) and :setvar
  • :on error handling
  • Plain, sqlcmd, and extended sqlcmdex parsing modes
  • Fully asynchronous parsing and execution, from strings or files, with cancellation support
  • Exact line/column metadata per batch
  • Structured execution events (messages, batch start/end, result sets) and a typed execution result

Installation

dotnet add package ItTiger.TigerQuery

Quick start

using ItTiger.TigerQuery;
using ItTiger.TigerQuery.Engine;

var options = new TigerQueryEngineOptions
{
    ConnectionString = "Server=localhost;Database=master;Integrated Security=true",
    Mode = SqlCmdMode.SqlCmd,
    Variables = new Dictionary<string, string> { ["Env"] = "Dev" },
    OnMessage = (message, isException) => Console.WriteLine(message.Text),
    OnBatchEnd = end => Console.WriteLine(
        $"Batch {end.BatchNumber}: {(end.Success ? "ok" : "failed")} in {end.Duration.TotalMilliseconds:F0} ms"),
    OnResultSet = resultSet => Console.WriteLine(
        $"{resultSet.Rows.Count} row(s), {resultSet.Columns.Count} column(s)")
};

var engine = new TigerQueryEngine(options);

var result = await engine.RunFromStringAsync(
    """
    :setvar Greeting Hello
    PRINT '$(Greeting) from $(Env)';
    GO 2
    SELECT name FROM sys.databases;
    GO
    """);

Console.WriteLine($"{result.ResultCode}: {result.ExecutedBatches} batch(es) in {result.TotalDuration.TotalMilliseconds:F0} ms");

Use RunFromFileAsync(path) for script files and RunAsync(TextReader) for anything else. All run methods accept a CancellationToken; cancellation maps to ExecutionResultCode.UserCancelled.

How output is delivered

The engine never writes to the console. Everything flows through the callbacks on TigerQueryEngineOptions:

  • OnMessagePRINT, RAISERROR, info messages, and errors as SqlCmdMessage (severity, type, line number)
  • OnBatchStart / OnBatchEnd — batch progress, success, and duration
  • OnResultSet — column metadata (ColumnInfo) and rows (object?[])

Each run returns an ExecutionResult with an ExecutionResultCode (success, batch failure, fatal error, cancellation, connection failure, parse error, …), executed/failed batch counts, and total duration. An optional Microsoft.Extensions.Logging.ILogger receives structured logs.

  • ItTiger.TigerQuery.Core — saved SQL Server connection profiles (storage, validation, resolution). Independent of this package; combine them when you want named connections in front of the engine.
  • ItTiger.TigerQuery.CliCore — ready-made TigerCli connection-management commands for CLI applications.
  • tiger-sqlcmd — the ready-made CLI built on all three, distributed as GitHub release binaries.

An open-source project by IT Tigerhttps://www.ittiger.net/

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.1 50 7/12/2026