ItTiger.TigerQuery.Core 0.8.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package ItTiger.TigerQuery.Core --version 0.8.2
                    
NuGet\Install-Package ItTiger.TigerQuery.Core -Version 0.8.2
                    
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.Core" Version="0.8.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ItTiger.TigerQuery.Core" Version="0.8.2" />
                    
Directory.Packages.props
<PackageReference Include="ItTiger.TigerQuery.Core" />
                    
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.Core --version 0.8.2
                    
#r "nuget: ItTiger.TigerQuery.Core, 0.8.2"
                    
#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.Core@0.8.2
                    
#: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.Core&version=0.8.2
                    
Install as a Cake Addin
#tool nuget:?package=ItTiger.TigerQuery.Core&version=0.8.2
                    
Install as a Cake Tool

ItTiger.TigerQuery.Core

Reusable SQL Server connection-profile support for TigerQuery-family tools and any .NET application that wants named, saved connections instead of raw connection strings.

Intended consumers are tool and application developers: define profiles once (server, authentication, encryption, pooling, …), store them in a JSON file, and resolve them to Microsoft.Data.SqlClient connection strings by name.

Key types

  • SqlServerConnectionProfile — a named profile with first-class options (server, database, authentication, encryption, trust, application intent, timeouts, pooling), a free-form options escape hatch, and optional namespaced application metadata; builds a SqlConnectionStringBuilder / connection string.
  • SqlServerConnectionStore / SqlServerConnectionStoreOptions — JSON file storage with Shared(vendor) (a per-user vendor store shared across tools) and AppSpecific(vendor, app) locations, or any explicit FilePath; QueryByMetadata(...) applies reusable metadata filters.
  • SqlServerConnectionResolver / SqlServerConnectionResolution — name → connection string with clean failure messages.
  • SqlServerConnectionValidator / SqlServerConnectionValidationPolicy — profile validation (e.g. database required vs. optional).
  • IConnectionPasswordProtector — password-at-rest strategy: DpapiConnectionPasswordProtector, NonPersistingConnectionPasswordProtector, NoOpConnectionPasswordProtector, and ConnectionPasswordProtector.CreateDefault().
  • SqlServerDatabaseLister — async database enumeration for a profile.

Installation

dotnet add package ItTiger.TigerQuery.Core

Quick start

using ItTiger.TigerQuery.Core;

var store = new SqlServerConnectionStore(
    new SqlServerConnectionStoreOptions { FilePath = "connections.json" });

if (!store.Exists("local"))
{
    store.Add(new SqlServerConnectionProfile
    {
        Name = "local",
        Server = "localhost",
        Authentication = AuthenticationType.Integrated,
        Encrypt = EncryptOption.Mandatory,
        TrustServerCertificate = true
    });
}

var resolution = SqlServerConnectionResolver.Resolve(store, "local");
if (resolution.IsSuccess)
    Console.WriteLine($"Connection string ready ({resolution.ConnectionString!.Length} chars).");
else
    Console.WriteLine($"Failed: {resolution.ErrorMessage}");

Applications can attach namespaced, non-secret string metadata without affecting the generated SQL connection string:

var profile = store.Find("local")!;
profile.SetMetadata("yourvendor.yourapp.role", "automation-host");
store.AddOrUpdate(profile);

Metadata is opaque to TigerQuery, uses ordinal key comparison, and can be removed with profile.RemoveMetadata(key). Do not use it for passwords, tokens, or other secrets.

Profiles can be queried with ordinal, case-sensitive metadata predicates. Filters use AND semantics and results retain their order in the store:

var automationProfiles = store.QueryByMetadata(
[
    new SqlServerConnectionMetadataFilter
    {
        Key = "yourvendor.yourapp.role",
        Operator = SqlServerConnectionMetadataFilterOperator.Equals,
        Value = "automation-host"
    },
    new SqlServerConnectionMetadataFilter
    {
        Key = "yourvendor.yourapp.enabled",
        Operator = SqlServerConnectionMetadataFilterOperator.IsSet
    }
]);

For a real shared store, prefer SqlServerConnectionStoreOptions.Shared("YourVendor") (per-user application-data location on Windows, ~/.config elsewhere) so multiple tools see the same connections.

Password protection and platforms

SQL-password profiles never store plain-text passwords by default:

  • Windows: DpapiConnectionPasswordProtector encrypts the password at rest with DPAPI (current user). DPAPI is Windows-only; encrypted values do not roam to other machines or users.
  • Other operating systems: there is no DPAPI. ConnectionPasswordProtector.CreateDefault() falls back to NonPersistingConnectionPasswordProtector, which simply never saves the password — profiles still work, but the password must be supplied per session.
  • NoOpConnectionPasswordProtector performs no protection at all and is intended for tests or externally secured stores.

The store constructor accepts an explicit IConnectionPasswordProtector when you need to choose the strategy yourself.

  • ItTiger.TigerQuery.CliCore — ready-made TigerCli connections commands (list/show/add/edit/delete) built on this package.
  • ItTiger.TigerQuery — the standalone sqlcmd-compatible script engine; independent of this package and easy to combine with it.

An open-source project by IT Tiger — https://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 (2)

Showing the top 2 NuGet packages that depend on ItTiger.TigerQuery.Core:

Package Downloads
ItTiger.TigerQuery

Standalone SQL Server script parser and execution engine with familiar sqlcmd/SSMS SqlCmd-mode behavior: GO batch separators with repeat counts, sqlcmd variables and :setvar, :on error handling, asynchronous execution from strings or files, and structured execution callbacks and results.

ItTiger.TigerQuery.CliCore

Reusable TigerCli command group for SQL Server connection management in TigerQuery-family CLI applications: list/show/add/edit/delete commands with parser-driven prompting, provider-backed selection, validation, and en-US/pl-PL localization, built on ItTiger.TigerQuery.Core. Intended for developers building TigerCli applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.8 154 8/21/2026
0.8.6 144 8/5/2026
0.8.5 123 8/5/2026
0.8.4 135 8/4/2026
0.8.3 132 8/4/2026
0.8.2 123 7/30/2026
0.8.1 132 7/12/2026