---
title: "Adding Custom SQLite Library for PDF Search on iOS | Nutrient"
canonical_url: "https://www.nutrient.io/guides/ios/miscellaneous/custom-sqlite-library/"
md_url: "https://www.nutrient.io/guides/ios/miscellaneous/custom-sqlite-library.md"
last_updated: "2026-05-15T17:18:57.913Z"
description: "PSPDFKit for iOS doesn’t include a custom version of SQLite, as iOS comes with SQLite already bundled. Depending on the version of iOS."
---

# Adding a Custom SQLite Library for PDF Search on iOS

PSPDFKit for iOS doesn’t include a custom version of SQLite, as iOS comes with SQLite already bundled. Depending on the version of iOS, this version is different and will also have different capabilities enabled:

| iOS                                 | SQLite                                  |
| ----------------------------------- | --------------------------------------- |
| 12.0-12.1 / macOS High Sierra 10.14 | 3.24.0 with FTS5 Extension (2018-06-04) |
| 11.4                                | 3.19.3 with FTS5 Extension (2017-06-08) |
| 11.0 / macOS High Sierra 10.13      | 3.18.0 with FTS5 Extension (2017-03-28) |
| 10.3 / macOS Sierra 10.12.4         | 3.16.0 (2017-01-02)                     |
| 10.0-10.2 / macOS Sierra 10.12.0    | 3.14.0 (2016-08-08)                     |

If you see SQLite log warnings, [read up on our troubleshooting tips](https://www.nutrient.io/../../troubleshooting/sqlite-warnings).

[Check the SQLite website](https://www.sqlite.org/chronology.html) to see which version is the most current. Sometimes your app requires a specific SQLite version. Examples of such cases include:

- You need to have the same SQLite version on every iOS version you support.

- You want to use some new SQLite features that aren’t yet available in SQLite shipped with iOS.

- You want to encrypt your SQLite database (see [SQLite Database Encryption](https://www.nutrient.io/guides/ios/security/encryption-in-pdflibrary.md)).

- You want to use FTS5 with [`PDFLibrary`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdflibrary).

In such cases, you usually link your app with a custom build of SQLite.

## Detect Which Version Is Currently Active

Call the following in code to see which version of SQLite you currently use:

```c

// e.g. "3016000" for macOS 10.12.4
int sqliteVersion = sqlite3_libversion_number();

```

## PSPDFKit and a Custom SQLite Library

PSPDFKit is dynamically linked with the SQLite library provided by the iOS SDK. However, if you link your app with a custom SQLite library, PSPDFKit **will automatically use it**. You might want to remove the `-lsqlite3` string from `PSPDFKit.xcconfig` inside the framework to remove the system linking.

Make sure your custom SQLite library is built with the following flags:

- `SQLITE_THREADSAFE=1` or `SQLITE_THREADSAFE=2`

And if you’re using `PDFLibrary`, ensure you have the following flag to use FTS5:

- `SQLITE_ENABLE_FTS5`

And the following flags to use FTS4:

- `SQLITE_ENABLE_FTS3`

- `SQLITE_ENABLE_FTS3_PARENTHESIS`

PSPDFKit expects these options and fails early if any of them are missing.
---

## Related pages

- [Custom Tokenizers for PDF Search on iOS](/guides/ios/memory-and-storage/using-custom-tokenizers.md)
- [Generate PDF Search Previews on iOS](/guides/ios/search/indexed-full-text-search/customize-results.md)
- [Indexing PDF Documents on iOS](/guides/ios/features/indexed-full-text-search.md)
- [Encrypt the PDF Search Database on iOS](/guides/ios/security/encryption-in-pdflibrary.md)
- [Index and Search PDFs Using iOS Spotlight](/guides/ios/search/indexed-full-text-search/spotlight-indexing.md)
- [PDF Search Matching Options on iOS](/guides/ios/search/indexed-full-text-search/matching-options.md)

