# TraconSqliteOptions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.traconsqliteoptions/
> Summary: TraconSqliteOptions: Settings for Tracon's SQLite persistence layer.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Sqlite.dll</code></div>

Settings for Tracon's SQLite persistence layer.

```csharp
public sealed class TraconSqliteOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.traconsqliteoptions/">TraconSqliteOptions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

Validation is done manually in [Tracon.TraconSqliteOptionsValidator](/api/tracon/);
`DataAnnotations` is not used.

## Constructors

### <a id="Tracon_TraconSqliteOptions__ctor"></a> TraconSqliteOptions\(\)

```csharp
public TraconSqliteOptions()
```

## Fields

### <a id="Tracon_TraconSqliteOptions_SectionName"></a> SectionName

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

```csharp
public const string SectionName = "Tracon:Sqlite"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### <a id="Tracon_TraconSqliteOptions_AutoApplyMigrations"></a> AutoApplyMigrations

Whether pending migrations should be applied automatically at application startup.

```csharp
public bool AutoApplyMigrations { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_TraconSqliteOptions_CommandTimeoutSeconds"></a> CommandTimeoutSeconds

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

```csharp
public int CommandTimeoutSeconds { get; set; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_TraconSqliteOptions_ConnectionString"></a> ConnectionString

The SQLite connection string (example: `Data Source=tracon.db`).

```csharp
public string? ConnectionString { get; set; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

#### Remarks

A bare `Data Source=:memory:` is not supported: this library opens
a new connection for every operation via
[DbDataSource.CreateDbConnection](https://learn.microsoft.com/dotnet/api/system.data.common.dbdatasource), 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](/api/tracon/)).

### <a id="Tracon_TraconSqliteOptions_DataSource"></a> DataSource

The data source Tracon uses, instead of building its own from
[TraconSqliteOptions.ConnectionString](/api/tracon.traconsqliteoptions/#Tracon_TraconSqliteOptions_ConnectionString).

```csharp
public DbDataSource? DataSource { get; set; }
```

#### Property Value

 [DbDataSource](https://learn.microsoft.com/dotnet/api/system.data.common.dbdatasource)?

#### Remarks

`Microsoft.Data.Sqlite` does not itself offer a [DbDataSource](https://learn.microsoft.com/dotnet/api/system.data.common.dbdatasource)
implementation; give an adapter of your own if you need one. When set,
[TraconSqliteOptions.ConnectionString](/api/tracon.traconsqliteoptions/#Tracon_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.

### <a id="Tracon_TraconSqliteOptions_EnableReadViews"></a> EnableReadViews

Whether the "views" migration set is applied. Default [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

```csharp
public bool EnableReadViews { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### 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.

### <a id="Tracon_TraconSqliteOptions_TablePrefix"></a> TablePrefix

The prefix added to the names of Tracon tables. The consumer's own
tables are never touched, under any condition.

```csharp
public string TablePrefix { get; set; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

#### 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.
