Class SqlServerConnectionStoreOptions
- Namespace
- ItTiger.TigerQuery.Core
- Assembly
- ItTiger.TigerQuery.Core.dll
Specifies the JSON file used by a SqlServerConnectionStore.
public sealed class SqlServerConnectionStoreOptions
- Inheritance
-
SqlServerConnectionStoreOptions
- Inherited Members
Remarks
There is deliberately no universal default. Shared(string, string) suits a store
several applications from one vendor share, AppSpecific(string, string, string) isolates a
single application, and an explicit FilePath lets a host or test run
select any JSON file. The host makes that choice once, constructs one
SqlServerConnectionStore, and injects it everywhere.
Properties
FilePath
Gets the connection-profile JSON file path.
public required string FilePath { get; init; }
Property Value
Remarks
A relative path is resolved to an absolute one when the store is constructed
and is then exposed as FilePath.
MutationTimeout
Gets how long a mutating store operation waits for exclusive access to
FilePath before failing.
public TimeSpan MutationTimeout { get; init; }
Property Value
Remarks
The default is fifteen seconds. Exceeding the budget throws TimeoutException; the store is never mutated in that case, and the operation is safe to retry.
The wait covers both the in-process gate and the sibling
<file>.lock used to keep a second process — another tool, a CLI
session, or a test run — out of the same user store. The in-process guarantee
is absolute; the cross-process one holds for processes that use this library
and a file system with exclusive sharing semantics. A value of zero or less
disables waiting and fails immediately on contention.
Methods
AppSpecific(string, string, string)
Creates a per-user store location isolated to one application.
public static SqlServerConnectionStoreOptions AppSpecific(string vendorName, string appName, string fileName = "connections.json")
Parameters
vendorNamestring- The nonblank vendor directory name.
appNamestring- The nonblank application directory name.
fileNamestring- The nonblank JSON file name.
Returns
- SqlServerConnectionStoreOptions
- Options beneath vendor and application directories in the platform's per-user configuration root.
Exceptions
- ArgumentException
vendorName,appName, orfileNameis null, empty, or whitespace. The parameter name identifies the invalid argument.
Shared(string, string)
Creates a per-user store location shared by a vendor's applications.
public static SqlServerConnectionStoreOptions Shared(string vendorName, string fileName = "sqlserver-connections.json")
Parameters
Returns
- SqlServerConnectionStoreOptions
- Options beneath the roaming application-data directory on Windows or
~/.configon other supported platforms.
Exceptions
- ArgumentException
vendorNameorfileNameis null, empty, or whitespace. The parameter name identifies the invalid argument.