FTS5TableDefinition
public final class FTS5TableDefinition
The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.
You don’t create instances of this class. Instead, you use the Database
create(virtualTable:using:)
method:
try db.create(virtualTable: "document", using: FTS5()) { t in // t is FTS5TableDefinition
t.column("content")
}
-
The virtual table tokenizer
try db.create(virtualTable: "document", using: FTS5()) { t in t.tokenizer = .porter() }
See https://www.sqlite.org/fts5.html#fts5_table_creation_and_initialization
Declaration
Swift
public var tokenizer: FTS5TokenizerDescriptor?
-
The FTS5
content
optionWhen you want the full-text table to be synchronized with the content of an external table, prefer the
synchronize(withTable:)
method.Setting this property invalidates any synchronization previously established with the
synchronize(withTable:)
method.See https://www.sqlite.org/fts5.html#external_content_and_contentless_tables
Declaration
Swift
public var content: String? { get set }
-
The FTS5
content_rowid
optionWhen you want the full-text table to be synchronized with the content of an external table, prefer the
synchronize(withTable:)
method.Setting this property invalidates any synchronization previously established with the
synchronize(withTable:)
method.Declaration
Swift
public var contentRowID: String? { get set }
-
Support for the FTS5
prefix
optionDeclaration
Swift
public var prefixes: Set<Int>?
-
Support for the FTS5
columnsize
optionDeclaration
Swift
public var columnSize: Int?
-
Support for the FTS5
detail
optionDeclaration
Swift
public var detail: String?
-
Appends a table column.
try db.create(virtualTable: "document", using: FTS5()) { t in t.column("content") }
Declaration
Swift
@discardableResult public func column(_ name: String) -> FTS5ColumnDefinition
Parameters
name
the column name.
-
Synchronizes the full-text table with the content of an external table.
The full-text table is initially populated with the existing content in the external table. SQL triggers make sure that the full-text table is kept up to date with the external table.
Declaration
Swift
public func synchronize(withTable tableName: String)