ItTiger.TigerQuery.Core
0.8.2
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
<PackageReference Include="ItTiger.TigerQuery.Core" Version="0.8.2" />
<PackageVersion Include="ItTiger.TigerQuery.Core" Version="0.8.2" />
<PackageReference Include="ItTiger.TigerQuery.Core" />
paket add ItTiger.TigerQuery.Core --version 0.8.2
#r "nuget: ItTiger.TigerQuery.Core, 0.8.2"
#:package ItTiger.TigerQuery.Core@0.8.2
#addin nuget:?package=ItTiger.TigerQuery.Core&version=0.8.2
#tool nuget:?package=ItTiger.TigerQuery.Core&version=0.8.2
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 aSqlConnectionStringBuilder/ connection string.SqlServerConnectionStore/SqlServerConnectionStoreOptions— JSON file storage withShared(vendor)(a per-user vendor store shared across tools) andAppSpecific(vendor, app)locations, or any explicitFilePath;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, andConnectionPasswordProtector.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:
DpapiConnectionPasswordProtectorencrypts 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 toNonPersistingConnectionPasswordProtector, which simply never saves the password — profiles still work, but the password must be supplied per session. NoOpConnectionPasswordProtectorperforms 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.
Related packages
- ItTiger.TigerQuery.CliCore — ready-made TigerCli
connectionscommands (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.
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
- ItTiger.Core (>= 0.8.1)
- Microsoft.Data.SqlClient (>= 7.0.2)
- System.Security.Cryptography.ProtectedData (>= 10.0.10)
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.