From 12ca7d0fe29e7dbc14daebfc5259d8d703d062df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 16 Oct 2016 15:57:45 +0200 Subject: [PATCH] Documentation --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 739cd54ab..8522995d8 100644 --- a/README.md +++ b/README.md @@ -3197,20 +3197,20 @@ try db.create(virtualTable: "books", using: FTS4()) { t in // or FTS3(), or FTS5 t.column("body") } -// Populate full-text table with SQL or records +// Populate full-text table with records or SQL +try Book(...).insert(db) try db.execute( "INSERT INTO books (uuid, author, title, body) VALUES (?, ?, ?, ?)", arguments: [...]) -try Book(...).insert(db) // Build search patterns let pattern = FTS3Pattern(matchingPhrase: "Moby-Dick") -// Search with SQL or the query interface +// Search with the query interface or SQL +let books = Book.matching(pattern).fetchAll(db) let books = Book.fetchAll(db, "SELECT * FROM books WHERE books MATCH ?", arguments: [pattern]) -let books = Book.matching(pattern).fetchAll(db) ``` - [Choosing the Full-Text Engine](#choosing-the-full-text-engine)