.NET API
TraconPostgreSqlOptions
Tracon.PostgreSql.dllSettings for Tracon’s PostgreSQL persistence layer.
public sealed class TraconPostgreSqlOptionsInheritance
Section titled “Inheritance”object ← TraconPostgreSqlOptions
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 by hand in Tracon.TraconPostgreSqlOptionsValidator;
DataAnnotations is not used.
Constructors
Section titled “Constructors”TraconPostgreSqlOptions()
Section titled “ TraconPostgreSqlOptions()”public TraconPostgreSqlOptions()Fields
Section titled “Fields”SectionName
Section titled “ SectionName”The full path of the configuration section settings are read from.
public const string SectionName = "Tracon:PostgreSql"Field Value
Section titled “Field Value”Properties
Section titled “Properties”AutoApplyMigrations
Section titled “ AutoApplyMigrations”Whether pending migrations are applied automatically at application startup.
public bool AutoApplyMigrations { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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.
CommandTimeoutSeconds
Section titled “ CommandTimeoutSeconds”The 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 PostgreSQL connection string.
public string? ConnectionString { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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 TraconPostgreSqlOptions.DataSource is set; giving both is an error.
DataSource
Section titled “ DataSource”The data source Tracon uses, instead of building its own from TraconPostgreSqlOptions.ConnectionString.
public DbDataSource? DataSource { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Must be an NpgsqlDataSource (built with NpgsqlDataSourceBuilder)
— for example, the same instance an EF Core DbContext was configured
with via UseNpgsql(dataSource). When set, TraconPostgreSqlOptions.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.
var dataSource = new Npgsql.NpgsqlDataSourceBuilder(connectionString).Build();
// Also give the same instance to your own EF Core DbContext// (o => o.UseNpgsql(dataSource)) to share one connection pool.builder.AddTracon() .UsePostgreSql(o => o.DataSource = dataSource);EnableKnowledge
Section titled “ EnableKnowledge”Whether the “knowledge” migration set is applied. Default false.
public bool EnableKnowledge { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The knowledge set needs the pgvector extension; a
consumer on a managed PostgreSQL without permission to install
extensions never sees it unless this is turned on. While it is
false, no IVectorSearchStore is
registered — an agent definition that requests vector search fails
compilation with a clear error instead of a database error at run
time.
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 {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.
SchemaName
Section titled “ SchemaName”The schema Tracon’s tables are created in. The consumer’s public
schema is never touched, under any circumstances.
public string SchemaName { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Must follow the rules for an unquoted PostgreSQL identifier: starts with a lowercase letter or underscore, contains lowercase letters, digits, and underscores, at most 63 characters.