Method BuildCreateSql
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
namestringThe table name.
columnsIReadOnlyList<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 UNINDEXEDis still a column and its option.tokenizerFtsTokenizerThe tokenizer to use.
contentTablestringThe external-content table name, or null to omit
content=.
Returns
- string
The complete
CREATE VIRTUAL TABLEstatement.
Exceptions
- ArgumentException
nameis null, empty, or whitespace; orcolumnsis empty.- ArgumentNullException
columnsis 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
namestringcolumnsIReadOnlyList<string>tokenizerFtsTokenizeroptionsFtsTableOptions