Table of Contents

Method BuildCreateSql

Namespace
Qavren.Edge.Sqlite.Fts
Assembly
Qavren.Edge.Sqlite.dll

BuildCreateSql(string, IReadOnlyList<string>, FtsTokenizer, string?)

Builds the CREATE VIRTUAL TABLE ... USING fts5(...) statement for the given columns.

public static string BuildCreateSql(string name, IReadOnlyList<string> columns, FtsTokenizer tokenizer = FtsTokenizer.Unicode61, string? contentTable = null)

Parameters

name string

The table name.

columns IReadOnlyList<string>

The indexed column names; at least one is required. A name FTS5 could not read as it stands - created-at, my col - is written between double quotes. An entry holding = , ( ) [ ] or a quote character is written as given, because that is how an FTS5 option (detail=column) and an already-quoted name are spelled: quote such a name yourself. body UNINDEXED is still a column and its option.

tokenizer FtsTokenizer

The tokenizer to use.

contentTable string

The external-content table name, or null to omit content=.

Returns

string

The complete CREATE VIRTUAL TABLE statement.

Exceptions

ArgumentException

name is null, empty, or whitespace; or columns is empty.

ArgumentNullException

columns is null.

BuildCreateSql(string, IReadOnlyList<string>, FtsTokenizer, FtsTableOptions)

Options-taking overload. options is required and non-nullable so this never becomes ambiguous with the string? contentTable overload above.

public static string BuildCreateSql(string name, IReadOnlyList<string> columns, FtsTokenizer tokenizer, FtsTableOptions options)

Parameters

name string
columns IReadOnlyList<string>
tokenizer FtsTokenizer
options FtsTableOptions

Returns

string