ItTiger.TigerQuery
0.8.1
dotnet add package ItTiger.TigerQuery --version 0.8.1
NuGet\Install-Package ItTiger.TigerQuery -Version 0.8.1
<PackageReference Include="ItTiger.TigerQuery" Version="0.8.1" />
<PackageVersion Include="ItTiger.TigerQuery" Version="0.8.1" />
<PackageReference Include="ItTiger.TigerQuery" />
paket add ItTiger.TigerQuery --version 0.8.1
#r "nuget: ItTiger.TigerQuery, 0.8.1"
#:package ItTiger.TigerQuery@0.8.1
#addin nuget:?package=ItTiger.TigerQuery&version=0.8.1
#tool nuget:?package=ItTiger.TigerQuery&version=0.8.1
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
GObatch separators, including repeat counts (GO 5)- sqlcmd variables (
$(name)) and:setvar :on errorhandling- Plain,
sqlcmd, and extendedsqlcmdexparsing 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:
OnMessage—PRINT,RAISERROR, info messages, and errors asSqlCmdMessage(severity, type, line number)OnBatchStart/OnBatchEnd— batch progress, success, and durationOnResultSet— 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.
Related packages
- 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.
Links
- Project page: https://www.ittiger.net/projects/tigerquery/
- Repository: https://github.com/rkozlowski/TigerQuery
- License: MIT
An open-source project by IT Tiger — https://www.ittiger.net/
| Product | Versions 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. |
-
net10.0
- Microsoft.Data.SqlClient (>= 7.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
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 |