.NET API
TraconSqliteOptions
Tracon.Sqlite.dllSettings for Tracon’s SQLite persistence layer.
public sealed class TraconSqliteOptionsInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Validation is done manually in Tracon.TraconSqliteOptionsValidator;
DataAnnotations is not used.
Constructors
Section titled “Constructors”TraconSqliteOptions()
Section titled “ TraconSqliteOptions()”public TraconSqliteOptions()Fields
Section titled “Fields”SectionName
Section titled “ SectionName”The full path of the configuration section settings are read from.
public const string SectionName = "Tracon:Sqlite"Field Value
Section titled “Field Value”Properties
Section titled “Properties”AutoApplyMigrations
Section titled “ AutoApplyMigrations”Whether pending migrations should be applied automatically at application startup.
public bool AutoApplyMigrations { get; set; }Property Value
Section titled “Property Value”CommandTimeoutSeconds
Section titled “ CommandTimeoutSeconds”Upper time limit for a single SQL command (seconds). 0 means unlimited.
public int CommandTimeoutSeconds { get; set; }Property Value
Section titled “Property Value”ConnectionString
Section titled “ ConnectionString”The SQLite connection string (example: Data Source=tracon.db).
public string? ConnectionString { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”A bare Data Source=:memory: is not supported: this library opens
a new connection for every operation via
DbDataSource.CreateDbConnection, and in
SQLite a bare :memory: gives each connection its own isolated,
anonymous database — even adding Cache=Shared does not change this
(only a URI-form name can be shared). Result: migrations get applied on
one connection, the first query lands on a different (empty) database and
crashes with “no such table”. Use the URI form for a shared in-memory
database instead, e.g. Data Source=file:tracon?mode=memory&cache=shared
or Data Source=file::memory:?cache=shared. This setting is rejected
during validation (Tracon.TraconSqliteOptionsValidator).
DataSource
Section titled “ DataSource”The data source Tracon uses, instead of building its own from TraconSqliteOptions.ConnectionString.
public DbDataSource? DataSource { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Microsoft.Data.Sqlite does not itself offer a DbDataSource
implementation; give an adapter of your own if you need one. When set,
TraconSqliteOptions.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.
EnableReadViews
Section titled “ EnableReadViews”Whether the “views” migration set is applied. Default false.
public bool EnableReadViews { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Creates {prefix}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.
TablePrefix
Section titled “ TablePrefix”The prefix added to the names of Tracon tables. The consumer’s own tables are never touched, under any condition.
public string TablePrefix { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”SQLite has no schema concept; this is the SQLite equivalent (“do not touch the consumer’s schema”). The prefix goes through the SAME strict validation as PostgreSQL/SQL Server’s schema name: starts with a lowercase letter or underscore, contains lowercase letters, digits, and underscores, at most 63 characters.