FTS3
public struct FTS3 : VirtualTableModule
FTS3 lets you define “fts3” virtual tables.
// CREATE VIRTUAL TABLE document USING fts3(content)
try db.create(virtualTable: "document", using: FTS3()) { t in
t.column("content")
}
-
Options for Latin script characters. Matches the raw “remove_diacritics” tokenizer argument.
See https://www.sqlite.org/fts3.html
See moreDeclaration
Swift
public enum Diacritics
-
Creates a FTS3 module suitable for the Database
create(virtualTable:using:)
method.// CREATE VIRTUAL TABLE document USING fts3(content) try db.create(virtualTable: "document", using: FTS3()) { t in t.column("content") }
Declaration
Swift
public init()
-
Returns an array of tokens found in the string argument.
For example:
FTS3.tokenize("SQLite database") // ["sqlite", "database"] FTS3.tokenize("Gustave Doré") // ["gustave", "doré"])
Results can be altered with an explicit tokenizer - default is
.simple
. See https://www.sqlite.org/fts3.html#tokenizer.FTS3.tokenize("SQLite database", withTokenizer: .porter) // ["sqlite", "databas"] FTS3.tokenize("Gustave Doré", withTokenizer: .unicode61()) // ["gustave", "dore"])
Tokenization is performed by the
fts3tokenize
virtual table described at https://www.sqlite.org/fts3.html#querying_tokenizers.Declaration
Swift
public static func tokenize( _ string: String, withTokenizer tokenizer: FTS3TokenizerDescriptor = .simple) -> [String]
-
The virtual table module name
Declaration
Swift
public let moduleName: String
-
Reserved; part of the VirtualTableModule protocol.
See Database.create(virtualTable:using:)
Declaration
Swift
public func makeTableDefinition() -> FTS3TableDefinition
-
Reserved; part of the VirtualTableModule protocol.
See Database.create(virtualTable:using:)
Declaration
Swift
public func makeTableDefinition(configuration: VirtualTableConfiguration) -> FTS3TableDefinition
-
Reserved; part of the VirtualTableModule protocol.
See Database.create(virtualTable:using:)
Declaration
Swift
public func moduleArguments(for definition: FTS3TableDefinition, in db: Database) -> [String]
-
Reserved; part of the VirtualTableModule protocol.
See Database.create(virtualTable:using:)
Declaration
Swift
public func database(_ db: Database, didCreate tableName: String, using definition: FTS3TableDefinition)