Table of Contents

Class TigerQueryCliOptions

Namespace
ItTiger.TigerQuery.CliCore
Assembly
ItTiger.TigerQuery.CliCore.dll
The TigerQuery configuration a host application supplies once and every part of a run reads from: the application default connection-store file, and the store selected for the current run once TigerQueryCliContribution has applied --tq-connection-store-file.
public sealed class TigerQueryCliOptions
Inheritance
TigerQueryCliOptions
Inherited Members

Remarks

A host creates one instance, hands it to a TigerQueryCliContribution, and passes that same instance to TigerQuery and to its own command factories and services. Two instances, or one instance registered and a different one given to the commands, means the run resolves a store path that nothing reads — so share exactly one.

The host-supplied members are set once at composition time. The run-selected members (ExplicitConnectionStoreFile, ResolvedStorePath, and Store) are filled in by the contribution callback, which TigerCli invokes once per command run before command settings are bound. They are null, and Store throws, until then — including throughout help rendering, which never invokes callbacks.

This type is not thread-safe, and one app instance is not intended to run twice concurrently. Sequential runs of the same app are supported: each run's callback replaces the previous run's resolution and store rather than adding to it.

Properties

DefaultConnectionStoreFile

Gets the application's default connection-store file path. Required.
public required string DefaultConnectionStoreFile { get; init; }

Property Value

string

Remarks

TigerQuery defines no universal default, so the host must name one — typically from Shared(string, string) or AppSpecific(string, string, string). It applies when neither --tq-connection-store-file nor ConnectionStoreFile supplies a value, and it is the one part of the resolution that is known at build time, so help text may mention it.

DefaultE2eBootstrapConnectionName

Gets the connection name the host treats as its default E2E bootstrap profile, or null when the host configures none.
public string? DefaultE2eBootstrapConnectionName { get; init; }

Property Value

string

Remarks

Host configuration only: it names a convention and is used by connection add-e2e-bootstrap when that command receives no --name. It confers no authorization; a profile becomes usable for E2E work through explicit TigerQuery metadata, never through its name.

EnvironmentReader

Gets the environment lookup, or null to read the process environment.
public Func<string, string?>? EnvironmentReader { get; init; }

Property Value

Func<string, string>

Remarks

Passed straight to EnvironmentReader. Injecting it lets a test cover environment precedence without mutating process-global state.

ExplicitConnectionStoreFile

Gets the value supplied to --tq-connection-store-file for the current run, or null when the option was absent or the callback has not run.
public string? ExplicitConnectionStoreFile { get; }

Property Value

string

Remarks

The raw value as typed. ResolvedStorePath carries the normalized absolute path actually selected, which is what diagnostics should show.

PasswordProtectorFactory

Gets the password strategy for the run's store, or null for the platform default.
public Func<IConnectionPasswordProtector>? PasswordProtectorFactory { get; init; }

Property Value

Func<IConnectionPasswordProtector>

Remarks

Invoked once, when Store is first constructed. Protector selection stays a host concern and is independent of which file the run selected; a host that needs NonPersistingConnectionPasswordProtector on a build agent keeps it whichever way the path was chosen.

ResolvedStorePath

Gets the store-path resolution for the current run, or null before the contribution callback has run.
public SqlServerConnectionStorePathResolution? ResolvedStorePath { get; }

Property Value

SqlServerConnectionStorePathResolution

Remarks

A failed resolution ends the run with a validation error before any command binds, so a successful command handler always observes a successful resolution. Source reports whether the CLI option, the environment variable, or DefaultConnectionStoreFile won.

Store

Gets the one connection store for the current run.
public SqlServerConnectionStore Store { get; }

Property Value

SqlServerConnectionStore

Remarks

Constructed on first access from ResolvedStorePath and returned unchanged afterwards, so every command, provider, and host service that reads this property shares one instance — and therefore one file, one lock, and one in-process mutation gate.

Exceptions

InvalidOperationException
The contribution callback has not run, which means the host did not register the contribution or shared a different options instance with it; or the callback resolved a failure, which normally ends the run before any command can ask.