mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Documentation
This commit is contained in:
1 parent
e5d941f98b
commit
8ed0888ea8
2 files changed
+19
-6
No files matched your search
@@ -113,8 +113,6 @@
|
||||
/// https://www.sqlite.org/fts5.html#the_detail_option
|
||||
public var detail: String?
|
||||
|
||||
/// TODO: columnsize, detail
|
||||
|
||||
/// Appends a table column.
|
||||
///
|
||||
/// try db.create(virtualTable: "documents", using: FTS5()) { t in
|
||||
|
||||
@@ -93,12 +93,13 @@
|
||||
}
|
||||
|
||||
extension FTS5Pattern : DatabaseValueConvertible {
|
||||
/// TODO
|
||||
/// Returns a value that can be stored in the database.
|
||||
public var databaseValue: DatabaseValue {
|
||||
return rawPattern.databaseValue
|
||||
}
|
||||
|
||||
/// TODO
|
||||
/// Returns an FTS5Pattern initialized from *databaseValue*, if it
|
||||
/// contains a suitable value.
|
||||
public static func fromDatabaseValue(_ databaseValue: DatabaseValue) -> FTS5Pattern? {
|
||||
return String
|
||||
.fromDatabaseValue(databaseValue)
|
||||
@@ -110,7 +111,12 @@
|
||||
|
||||
// MARK: Full Text Search
|
||||
|
||||
/// TODO
|
||||
/// Returns a new QueryInterfaceRequest with a matching predicate added
|
||||
/// to the eventual set of already applied predicates.
|
||||
///
|
||||
/// // SELECT * FROM books WHERE books MATCH '...'
|
||||
/// var request = Book.all()
|
||||
/// request = request.matching(pattern)
|
||||
public func matching(_ pattern: FTS5Pattern) -> QueryInterfaceRequest<T> {
|
||||
switch query.source {
|
||||
case .table(let name, let alias)?:
|
||||
@@ -125,7 +131,16 @@
|
||||
|
||||
// MARK: Full Text Search
|
||||
|
||||
/// TODO
|
||||
/// Returns a QueryInterfaceRequest with a matching predicate.
|
||||
///
|
||||
/// // SELECT * FROM books WHERE books MATCH '...'
|
||||
/// var request = Book.matching(pattern)
|
||||
///
|
||||
/// If the `selectsRowID` type property is true, then the selection
|
||||
/// includes the hidden "rowid" column:
|
||||
///
|
||||
/// // SELECT *, rowid FROM books WHERE books MATCH '...'
|
||||
/// var request = Book.matching(pattern)
|
||||
public static func matching(_ pattern: FTS5Pattern) -> QueryInterfaceRequest<Self> {
|
||||
return all().matching(pattern)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user