Table of Contents

Class SQLiteExtensions

Namespace
LinqToDB.DataProvider.SQLite
Assembly
linq2db.dll
public static class SQLiteExtensions
Inheritance
SQLiteExtensions
Inherited Members

Methods

FTS3AutoMergeAsync<TEntity>(IDataContext, ITable<TEntity>, int, CancellationToken)

Executes FTS3/FTS4 'automerge' command for specific table. Example: "INSERT INTO table(table) VALUES('automerge=segments')".

public static Task FTS3AutoMergeAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, int segments, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

segments int

Segments command parameter.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS3AutoMerge<TEntity>(IDataContext, ITable<TEntity>, int)

Executes FTS3/FTS4 'automerge' command for specific table. Example: "INSERT INTO table(table) VALUES('automerge=segments')".

public static void FTS3AutoMerge<TEntity>(this IDataContext dc, ITable<TEntity> table, int segments) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

segments int

Segments command parameter.

Type Parameters

TEntity

Table mapping class.

FTS3IntegrityCheckAsync<TEntity>(IDataContext, ITable<TEntity>, CancellationToken)

Executes FTS3/FTS4 'integrity-check' command for specific table. Example: "INSERT INTO table(table) VALUES('integrity-check')".

public static Task FTS3IntegrityCheckAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS3IntegrityCheck<TEntity>(IDataContext, ITable<TEntity>)

Executes FTS3/FTS4 'integrity-check' command for specific table. Example: "INSERT INTO table(table) VALUES('integrity-check')".

public static void FTS3IntegrityCheck<TEntity>(this IDataContext dc, ITable<TEntity> table) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

Type Parameters

TEntity

Table mapping class.

FTS3MatchInfo<TEntity>(ISQLiteExtensions?, TEntity)

FTS3/4 matchinfo(fts_table) function. Example: "matchinfo(table)".

[ExpressionMethod("Fts3MatchInfoImpl1")]
public static byte[] FTS3MatchInfo<TEntity>(this ISQLiteExtensions? ext, TEntity entity) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

Returns

byte[]

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS3MatchInfo<TEntity>(ISQLiteExtensions?, TEntity, string)

FTS3/4 matchinfo(fts_table, format) function. Example: "matchinfo(table, 'format')".

[ExpressionMethod("Fts3MatchInfoImpl2")]
public static byte[] FTS3MatchInfo<TEntity>(this ISQLiteExtensions? ext, TEntity entity, string format) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

format string

Format string function parameter.

Returns

byte[]

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS3MergeAsync<TEntity>(IDataContext, ITable<TEntity>, int, int, CancellationToken)

Executes FTS3/FTS4 'merge' command for specific table. Example: "INSERT INTO table(table) VALUES('merge=blocks,segments')".

public static Task FTS3MergeAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, int blocks, int segments, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

blocks int

Blocks command parameter.

segments int

Segments command parameter.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS3Merge<TEntity>(IDataContext, ITable<TEntity>, int, int)

Executes FTS3/FTS4 'merge' command for specific table. Example: "INSERT INTO table(table) VALUES('merge=blocks,segments')".

public static void FTS3Merge<TEntity>(this IDataContext dc, ITable<TEntity> table, int blocks, int segments) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

blocks int

Blocks command parameter.

segments int

Segments command parameter.

Type Parameters

TEntity

Table mapping class.

FTS3Offsets<TEntity>(ISQLiteExtensions?, TEntity)

FTS3/4 offsets(fts_table) function. Example: "offsets(table)".

[ExpressionMethod("Fts3OffsetsImpl")]
public static string FTS3Offsets<TEntity>(this ISQLiteExtensions? ext, TEntity entity) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS3OptimizeAsync<TEntity>(IDataContext, ITable<TEntity>, CancellationToken)

Executes FTS3/FTS4 'optimize' command for specific table. Example: "INSERT INTO table(table) VALUES('optimize')".

public static Task FTS3OptimizeAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS3Optimize<TEntity>(IDataContext, ITable<TEntity>)

Executes FTS3/FTS4 'optimize' command for specific table. Example: "INSERT INTO table(table) VALUES('optimize')".

public static void FTS3Optimize<TEntity>(this IDataContext dc, ITable<TEntity> table) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

Type Parameters

TEntity

Table mapping class.

FTS3RebuildAsync<TEntity>(IDataContext, ITable<TEntity>, CancellationToken)

Executes FTS3/FTS4 'rebuild' command for specific table. Example: "INSERT INTO table(table) VALUES('rebuild')".

public static Task FTS3RebuildAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS3Rebuild<TEntity>(IDataContext, ITable<TEntity>)

Executes FTS3/FTS4 'rebuild' command for specific table. Example: "INSERT INTO table(table) VALUES('rebuild')".

public static void FTS3Rebuild<TEntity>(this IDataContext dc, ITable<TEntity> table) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

Type Parameters

TEntity

Table mapping class.

FTS3Snippet<TEntity>(ISQLiteExtensions?, TEntity)

FTS3/4 snippet(fts_table) function. Example: "snippet(table)".

[ExpressionMethod("Fts3SnippetImpl1")]
public static string FTS3Snippet<TEntity>(this ISQLiteExtensions? ext, TEntity entity) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS3Snippet<TEntity>(ISQLiteExtensions?, TEntity, string)

FTS3/4 snippet(fts_table, startMatch) function. Example: "snippet(table, 'startMatch')".

[ExpressionMethod("Fts3SnippetImpl2")]
public static string FTS3Snippet<TEntity>(this ISQLiteExtensions? ext, TEntity entity, string startMatch) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

startMatch string

Start match wrap text.

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS3Snippet<TEntity>(ISQLiteExtensions?, TEntity, string, string)

FTS3/4 snippet(fts_table, startMatch, endMatch) function. Example: "snippet(table, 'startMatch', 'endMatch')".

[ExpressionMethod("Fts3SnippetImpl3")]
public static string FTS3Snippet<TEntity>(this ISQLiteExtensions? ext, TEntity entity, string startMatch, string endMatch) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

startMatch string

Start match wrap text.

endMatch string

End match wrap text.

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS3Snippet<TEntity>(ISQLiteExtensions?, TEntity, string, string, string)

FTS3/4 snippet(fts_table, startMatch, endMatch, ellipses) function. Example: "snippet(table, 'startMatch', 'endMatch', 'ellipses')".

[ExpressionMethod("Fts3SnippetImpl4")]
public static string FTS3Snippet<TEntity>(this ISQLiteExtensions? ext, TEntity entity, string startMatch, string endMatch, string ellipses) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

startMatch string

Start match wrap text.

endMatch string

End match wrap text.

ellipses string

Ellipses text.

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS3Snippet<TEntity>(ISQLiteExtensions?, TEntity, string, string, string, int)

FTS3/4 snippet(fts_table, startMatch, endMatch, ellipses, columnIndex) function. Example: "snippet(table, 'startMatch', 'endMatch', 'ellipses', columnIndex)".

[ExpressionMethod("Fts3SnippetImpl5")]
public static string FTS3Snippet<TEntity>(this ISQLiteExtensions? ext, TEntity entity, string startMatch, string endMatch, string ellipses, int columnIndex) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

startMatch string

Start match wrap text.

endMatch string

End match wrap text.

ellipses string

Ellipses text.

columnIndex int

Index of column to extract snippet from. -1 matches all columns.

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS3Snippet<TEntity>(ISQLiteExtensions?, TEntity, string, string, string, int, int)

FTS3/4 snippet(fts_table, startMatch, endMatch, ellipses, columnIndex, tokensNumber) function. Example: "snippet(table, 'startMatch', 'endMatch', 'ellipses', columnIndex, tokensNumber)".

[ExpressionMethod("Fts3SnippetImpl6")]
public static string FTS3Snippet<TEntity>(this ISQLiteExtensions? ext, TEntity entity, string startMatch, string endMatch, string ellipses, int columnIndex, int tokensNumber) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

startMatch string

Start match wrap text.

endMatch string

End match wrap text.

ellipses string

Ellipses text.

columnIndex int

Index of column to extract snippet from. -1 matches all columns.

tokensNumber int

Manages how many tokens should be returned (check function documentation).

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS3/4.

FTS5AutoMergeAsync<TEntity>(IDataContext, ITable<TEntity>, int, CancellationToken)

Executes FTS5 'automerge' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('automerge', value)".

public static Task FTS5AutoMergeAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, int value, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5AutoMerge<TEntity>(IDataContext, ITable<TEntity>, int)

Executes FTS5 'automerge' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('automerge', value)".

public static void FTS5AutoMerge<TEntity>(this IDataContext dc, ITable<TEntity> table, int value) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

Type Parameters

TEntity

Table mapping class.

FTS5CrisisMergeAsync<TEntity>(IDataContext, ITable<TEntity>, int, CancellationToken)

Executes FTS5 'crisismerge' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('crisismerge', value)".

public static Task FTS5CrisisMergeAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, int value, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5CrisisMerge<TEntity>(IDataContext, ITable<TEntity>, int)

Executes FTS5 'crisismerge' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('crisismerge', value)".

public static void FTS5CrisisMerge<TEntity>(this IDataContext dc, ITable<TEntity> table, int value) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

Type Parameters

TEntity

Table mapping class.

FTS5DeleteAllAsync<TEntity>(IDataContext, ITable<TEntity>, CancellationToken)

Executes FTS5 'delete-all' command for specific table. Example: "INSERT INTO table(table) VALUES('delete-all')".

public static Task FTS5DeleteAllAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5DeleteAll<TEntity>(IDataContext, ITable<TEntity>)

Executes FTS5 'delete-all' command for specific table. Example: "INSERT INTO table(table) VALUES('delete-all')".

public static void FTS5DeleteAll<TEntity>(this IDataContext dc, ITable<TEntity> table) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

Type Parameters

TEntity

Table mapping class.

FTS5DeleteAsync<TEntity>(IDataContext, ITable<TEntity>, int, TEntity, CancellationToken)

Executes FTS5 'delete' command for specific table. Example: "INSERT INTO table(table, rowid, col1, col2) VALUES('delete', rowid, 'col1_value', 'col2_value')".

public static Task FTS5DeleteAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, int rowid, TEntity record, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

rowid int

Record rowid value.

record TEntity

Current record entity.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5Delete<TEntity>(IDataContext, ITable<TEntity>, int, TEntity)

Executes FTS5 'delete' command for specific table. Example: "INSERT INTO table(table, rowid, col1, col2) VALUES('delete', rowid, 'col1_value', 'col2_value')".

public static void FTS5Delete<TEntity>(this IDataContext dc, ITable<TEntity> table, int rowid, TEntity record) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

rowid int

Record rowid value.

record TEntity

Current record entity.

Type Parameters

TEntity

Table mapping class.

FTS5Highlight<TEntity>(ISQLiteExtensions?, TEntity, int, string, string)

FTS5 highlight(fts_table, columnIndex, startMatch, endMatch) function. Example: "highlight(table, columnIndex, 'startMatch', 'endMatch')".

[ExpressionMethod("Fts5HighlightImpl")]
public static string FTS5Highlight<TEntity>(this ISQLiteExtensions? ext, TEntity entity, int columnIndex, string startMatch, string endMatch) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

columnIndex int

Index of column to extract highlighted text from.

startMatch string

Start match wrap text.

endMatch string

End match wrap text.

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS5.

FTS5IntegrityCheckAsync<TEntity>(IDataContext, ITable<TEntity>, CancellationToken)

Executes FTS5 'integrity-check' command for specific table. Example: "INSERT INTO table(table) VALUES('integrity-check')".

public static Task FTS5IntegrityCheckAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5IntegrityCheck<TEntity>(IDataContext, ITable<TEntity>)

Executes FTS5 'integrity-check' command for specific table. Example: "INSERT INTO table(table) VALUES('integrity-check')".

public static void FTS5IntegrityCheck<TEntity>(this IDataContext dc, ITable<TEntity> table) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

Type Parameters

TEntity

Table mapping class.

FTS5MergeAsync<TEntity>(IDataContext, ITable<TEntity>, int, CancellationToken)

Executes FTS5 'merge' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('merge', value)".

public static Task FTS5MergeAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, int value, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5Merge<TEntity>(IDataContext, ITable<TEntity>, int)

Executes FTS5 'merge' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('merge', value)".

public static void FTS5Merge<TEntity>(this IDataContext dc, ITable<TEntity> table, int value) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

Type Parameters

TEntity

Table mapping class.

FTS5OptimizeAsync<TEntity>(IDataContext, ITable<TEntity>, CancellationToken)

Executes FTS5 'optimize' command for specific table. Example: "INSERT INTO table(table) VALUES('optimize')".

public static Task FTS5OptimizeAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5Optimize<TEntity>(IDataContext, ITable<TEntity>)

Executes FTS5 'optimize' command for specific table. Example: "INSERT INTO table(table) VALUES('optimize')".

public static void FTS5Optimize<TEntity>(this IDataContext dc, ITable<TEntity> table) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

Type Parameters

TEntity

Table mapping class.

FTS5PgszAsync<TEntity>(IDataContext, ITable<TEntity>, int, CancellationToken)

Executes FTS5 'pgsz' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('pgsz', value)".

public static Task FTS5PgszAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, int value, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5Pgsz<TEntity>(IDataContext, ITable<TEntity>, int)

Executes FTS5 'pgsz' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('pgsz', value)".

public static void FTS5Pgsz<TEntity>(this IDataContext dc, ITable<TEntity> table, int value) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

Type Parameters

TEntity

Table mapping class.

FTS5RankAsync<TEntity>(IDataContext, ITable<TEntity>, string, CancellationToken)

Executes FTS5 'rank' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('rank', 'function')".

public static Task FTS5RankAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, string function, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

function string

Rank function.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5Rank<TEntity>(IDataContext, ITable<TEntity>, string)

Executes FTS5 'rank' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('rank', 'function')".

public static void FTS5Rank<TEntity>(this IDataContext dc, ITable<TEntity> table, string function) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

function string

Rank function.

Type Parameters

TEntity

Table mapping class.

FTS5RebuildAsync<TEntity>(IDataContext, ITable<TEntity>, CancellationToken)

Executes FTS5 'rebuild' command for specific table. Example: "INSERT INTO table(table) VALUES('rebuild')".

public static Task FTS5RebuildAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5Rebuild<TEntity>(IDataContext, ITable<TEntity>)

Executes FTS5 'rebuild' command for specific table. Example: "INSERT INTO table(table) VALUES('rebuild')".

public static void FTS5Rebuild<TEntity>(this IDataContext dc, ITable<TEntity> table) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

Type Parameters

TEntity

Table mapping class.

FTS5Snippet<TEntity>(ISQLiteExtensions?, TEntity, int, string, string, string, int)

FTS5 snippet(fts_table, columnIndex, startMatch, endMatch, ellipses, tokensNumber) function. Example: "snippet(table, columnIndex, 'startMatch', 'endMatch', 'ellipses', tokensNumber)".

[ExpressionMethod("Fts5SnippetImpl")]
public static string FTS5Snippet<TEntity>(this ISQLiteExtensions? ext, TEntity entity, int columnIndex, string startMatch, string endMatch, string ellipses, int tokensNumber) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

columnIndex int

Index of column to extract snippet from.

startMatch string

Start match wrap text.

endMatch string

End match wrap text.

ellipses string

Ellipses text.

tokensNumber int

Manages how many tokens should be returned (check function documentation).

Returns

string

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS5.

FTS5UserMergeAsync<TEntity>(IDataContext, ITable<TEntity>, int, CancellationToken)

Executes FTS5 'usermerge' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('usermerge', value)".

public static Task FTS5UserMergeAsync<TEntity>(this IDataContext dc, ITable<TEntity> table, int value, CancellationToken cancellationToken = default) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Returns task.

Type Parameters

TEntity

Table mapping class.

FTS5UserMerge<TEntity>(IDataContext, ITable<TEntity>, int)

Executes FTS5 'usermerge' command for specific table. Example: "INSERT INTO table(table, rank) VALUES('usermerge', value)".

public static void FTS5UserMerge<TEntity>(this IDataContext dc, ITable<TEntity> table, int value) where TEntity : class

Parameters

dc IDataContext

IDataContext instance.

table ITable<TEntity>

FTS table.

value int

Command parameter.

Type Parameters

TEntity

Table mapping class.

FTS5bm25<TEntity>(ISQLiteExtensions?, TEntity)

FTS5 bm25(fts_table) function. Example: "bm25(table)".

[ExpressionMethod("Fts5bm25Impl1")]
public static double FTS5bm25<TEntity>(this ISQLiteExtensions? ext, TEntity entity) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

Returns

double

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS5.

FTS5bm25<TEntity>(ISQLiteExtensions?, TEntity, params double[])

FTS5 bm25(fts_table, ...weights) function. Example: "bm25(table, col1_weight, col2_weight)".

[ExpressionMethod("Fts5bm25Impl2")]
public static double FTS5bm25<TEntity>(this ISQLiteExtensions? ext, TEntity entity, params double[] weights) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Full-text search table.

weights double[]

Weights for columns (each value appied to corresponding column).

Returns

double

Check documentation of SQLite site.

Type Parameters

TEntity

Full-text search table mapping class.

Remarks

FTS Support: FTS5.

Match(ISQLiteExtensions?, object?, string)

Applies full-text search condition using MATCH predicate against whole FTS table or specific column. Examples: "table MATCH 'search query'"/"table.column MATCH 'search query'".

[ExpressionMethod("MatchImpl1")]
public static bool Match(this ISQLiteExtensions? ext, object? entityOrColumn, string match)

Parameters

ext ISQLiteExtensions

Extension point.

entityOrColumn object

Table or column to perform full-text search against.

match string

Full-text search condition.

Returns

bool

Returns true if full-text search found matching records.

Remarks

FTS Support: FTS3/4, FTS5.

MatchTable<TEntity>(ISQLiteExtensions?, ITable<TEntity>, string)

Performs full-text search query against specified table and returns search results. Example: "table('search query')".

[ExpressionMethod("MatchTableImpl1")]
public static IQueryable<TEntity> MatchTable<TEntity>(this ISQLiteExtensions? ext, ITable<TEntity> table, string match) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

table ITable<TEntity>

Table to perform full-text search against.

match string

Full-text search condition.

Returns

IQueryable<TEntity>

Returns table, filtered using specified search condition, applied to whole table.

Type Parameters

TEntity

Queried table mapping class.

Remarks

FTS Support: FTS5.

Rank<TEntity>(ISQLiteExtensions?, TEntity)

Provides access to FTS5 rank hidden column. Example: "table.rank".

[ExpressionMethod("RankImpl")]
public static double? Rank<TEntity>(this ISQLiteExtensions? ext, TEntity entity) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Table record instance.

Returns

double?

Returns rank column value.

Type Parameters

TEntity

Type of table mapping class.

Remarks

FTS Support: FTS5.

RowId<TEntity>(ISQLiteExtensions?, TEntity)

Provides access to rowid hidden column. Example: "table.rowid".

[ExpressionMethod("RowIdImpl")]
public static int RowId<TEntity>(this ISQLiteExtensions? ext, TEntity entity) where TEntity : class

Parameters

ext ISQLiteExtensions

Extension point.

entity TEntity

Table record instance.

Returns

int

Returns rowid column value.

Type Parameters

TEntity

Type of table mapping class.

SQLite(ISqlExtension?)

public static ISQLiteExtensions? SQLite(this Sql.ISqlExtension? ext)

Parameters

ext Sql.ISqlExtension

Returns

ISQLiteExtensions