From cc567f25554130447b8f8aee40cb0d364cca0ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 1 Mar 2023 08:23:36 +0100 Subject: [PATCH] Expose the fts5_api structure --- CHANGELOG.md | 4 ++++ GRDB/FTS/FTS5.swift | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d3e1630..1cfb0ca24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -106,6 +106,10 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: --- +## Next Release + +- **New**: `FTS5.api(db)` returns a pointer to the `fts5_api` structure, useful for low-level [FTS5 customization](https://www.sqlite.org/fts5.html#extending_fts5). + ## 6.8.0 Released February 24, 2023 • [diff](https://github.com/groue/GRDB.swift/compare/v6.7.0...v6.8.0) diff --git a/GRDB/FTS/FTS5.swift b/GRDB/FTS/FTS5.swift index 1d1c67a7b..333a2f226 100644 --- a/GRDB/FTS/FTS5.swift +++ b/GRDB/FTS/FTS5.swift @@ -35,6 +35,10 @@ import Foundation /// - ``FTS5WrapperTokenizer`` /// - ``FTS5TokenFlags`` /// - ``FTS5Tokenization`` +/// +/// ### Low-Level FTS5 Customization +/// +/// - ``api(_:)`` public struct FTS5 { /// Options for Latin script characters. Matches the raw "remove_diacritics" /// tokenizer argument. @@ -100,7 +104,10 @@ public struct FTS5 { } } - static func api(_ db: Database) -> UnsafePointer { + /// Returns a pointer to the `fts5_api` structure. + /// + /// Related SQLite documentation: + public static func api(_ db: Database) -> UnsafePointer { // Access to FTS5 is one of the rare SQLite api which was broken in // SQLite 3.20.0+, for security reasons: //