Skip to content
Tracon

TraconSqlServerOptions

Namespace Tracon · Assembly Tracon.SqlServer.dll

Settings for Tracon’s SQL Server persistence layer.

public sealed class TraconSqlServerOptions

objectTraconSqlServerOptions

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Validation is done by hand in Tracon.TraconSqlServerOptionsValidator; DataAnnotations is not used.

public TraconSqlServerOptions()

The full path of the configuration section settings are read from.

public const string SectionName = "Tracon:SqlServer"

string

Whether pending migrations are applied automatically at application startup.

public bool AutoApplyMigrations { get; set; }

bool

Can be set to false in production and MigrationRunner run as a separate deployment step, so a long-running migration does not block application startup.

The upper time limit for a single SQL command (seconds). 0 means unlimited.

public int CommandTimeoutSeconds { get; set; }

int

The SQL Server connection string.

public string? ConnectionString { get; set; }

string?

This value is a secret and is never written to a file. Use dotnet user-secrets, an environment variable, or a secret manager. Not required when TraconSqlServerOptions.DataSource is set; giving both is an error.

The data source Tracon uses, instead of building its own from TraconSqlServerOptions.ConnectionString.

public DbDataSource? DataSource { get; set; }

DbDataSource?

Microsoft.Data.SqlClient does not itself offer a DbDataSource implementation (measured against version 7.0.2); give an adapter of your own if you need to share a connection pool with another consumer of the same database. When set, TraconSqlServerOptions.ConnectionString is not required, and giving both is a startup error.

Tracon does not take ownership: the instance is never disposed. The caller keeps ownership and disposes it when the host shuts down.

Whether the “views” migration set is applied. Default false.

public bool EnableReadViews { get; set; }

bool

Creates {schema}.runs_v1, a versioned, read-only, narrow view a consumer can query directly (for example from an EF Core keyless entity) without depending on the internal runs table shape. Off by default: a consumer that never opts in pays nothing for it.

The schema Tracon’s tables are created in. The consumer’s dbo schema is never touched, under any circumstances.

public string SchemaName { get; set; }

string

Even though SQL Server allows a wider set of identifiers, Tracon enforces the same strict rule: starts with a lowercase letter or underscore, contains lowercase letters, digits, and underscores, at most 63 characters. This way the same schema name carries over between PostgreSQL and SQL Server without changes.