Table of Contents

Class SqliteFts5CommandBuilder

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Fluent terminal for a SQLite FTS5 maintenance/control command, started with CreateSqliteFts5CommandBuilder(IDataContext, string). The operation is issued through the FTS5 control interface (INSERT INTO <table>(...) VALUES(...)); a provider without FTS5 rejects it with NotSupportedException. The builder is immutable: every operation method returns a new builder and leaves the receiver unchanged.

public sealed class SqliteFts5CommandBuilder
Inheritance
SqliteFts5CommandBuilder
Inherited Members
Extension Methods

Methods

AutoMerge(int)

Selects the FTS5 automerge command, which merges up to value b-tree segments.

public SqliteFts5CommandBuilder AutoMerge(int value)

Parameters

value int

The automerge level; must be between 0 and 16 inclusive.

Returns

SqliteFts5CommandBuilder

A new builder carrying the automerge operation.

Exceptions

ArgumentOutOfRangeException

value is outside 0..16.

CrisisMerge(int)

Selects the FTS5 crisismerge command, which merges the value largest segments.

public SqliteFts5CommandBuilder CrisisMerge(int value)

Parameters

value int

The number of largest segments to merge; must not be negative.

Returns

SqliteFts5CommandBuilder

A new builder carrying the crisismerge operation.

Exceptions

ArgumentOutOfRangeException

value is negative.

Execute()

Executes the maintenance command and returns the affected-row count where the provider reports one.

public int Execute()

Returns

int

The affected-row count, or 0 where the provider reports none.

Exceptions

InvalidOperationException

No FTS5 maintenance command was selected.

NotSupportedException

The context is read-only, or the provider does not support SQLite FTS5.

ExecuteAsync(CancellationToken)

Asynchronously executes the maintenance command and returns the affected-row count where the provider reports one.

public Task<int> ExecuteAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancels execution.

Returns

Task<int>

A task producing the affected-row count, or 0 where the provider reports none.

Exceptions

InvalidOperationException

No FTS5 maintenance command was selected.

NotSupportedException

The context is read-only, or the provider does not support SQLite FTS5.

IntegrityCheck(bool?)

Selects the FTS5 integrity-check command, which validates the full-text index.

public SqliteFts5CommandBuilder IntegrityCheck(bool? checkExternalContent = null)

Parameters

checkExternalContent bool?

Whether to also verify the external content; null omits the rank argument, false passes 0 (internal consistency only) and true passes 1 (also verify the content table).

Returns

SqliteFts5CommandBuilder

A new builder carrying the integrity-check operation.

Merge(int)

Selects the FTS5 merge command, which merges pages pages of b-tree segments.

public SqliteFts5CommandBuilder Merge(int pages)

Parameters

pages int

The number of pages to merge; the signed value is passed through unchanged.

Returns

SqliteFts5CommandBuilder

A new builder carrying the merge operation.

Optimize()

Selects the FTS5 optimize command, which merges the whole full-text index into one segment.

public SqliteFts5CommandBuilder Optimize()

Returns

SqliteFts5CommandBuilder

A new builder carrying the optimize operation.

Rebuild()

Selects the FTS5 rebuild command, which rebuilds the full-text index from the content table.

public SqliteFts5CommandBuilder Rebuild()

Returns

SqliteFts5CommandBuilder

A new builder carrying the rebuild operation.

ToSql()

Renders the SQL this builder would execute, without executing it.

public string ToSql()

Returns

string

The rendered SQL text.

Exceptions

InvalidOperationException

No FTS5 maintenance command was selected.

NotSupportedException

The context is not database-backed, or the provider does not support SQLite FTS5.