# DBRepair development

**URL:** <https://forums.plex.tv/t/dbrepair-development/822684>\
**Category:** Apps & Creations\
**Created:** [December 14, 2022, 3:57am UTC](https://forums.plex.tv/t/dbrepair-development/822684 "2022-12-14T03:57:23Z")\
**Posts on this page:** 1\
**Showing post:** 935

<div class="post-metadata">

**Author:** ![pshanew](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/pshanew/32/160555_2.png) [@pshanew](https://forums.plex.tv/u/pshanew)\
**Post date:** [March 11, 2026, 12:33am UTC](https://forums.plex.tv/t/dbrepair-development/822684/935 "2026-03-11T00:33:17Z")

</div>

Having had a look at the sqlite3 docs a bit regarding how the integrity check of the FTS4 tables is being done in DBrepair.sh, I found this:

> **[SQLite FTS3 and FTS4 Extensions](https://sqlite.org/fts3.html)**

(See section 7.3)

That section outlines the means by which an integrity check is performed on a virtual table (e.g. the ‘fts4’ tables in the PMS DBs). The failure modes are described. The second one is:

> - Using the [FTS4 content option](https://sqlite.org/fts3.html#*fts4content) and failing to manually keep the content in sync with the FTS4 inverted indices.

I’m guessing that’s the failure mode being triggered. I assume that the database is reindexed occasionally as part of normal PMS background maintenance activities, but there are times when the `metadata_items` (from which `fts4_metadata_titles` is created) and `fts4_metadata_titles` become out of sync.

Any failure of the table integrity check returns a SQLITE\_CORRUPT error, regardless of the failure mode (even if the database isn’t _really_ corrupt).

This is mostly supposition, based on the docs (and how the fts4 virtual tables are created).

It’s interesting reading. I’d recommend reading the intro to section 7, plus the sections for the ‘integrity-check’ and ‘rebuild’ commands, for anyone interested.

* * *

For what it’s worth, here’s how the fts4\_metadata\_titles table is created in the PMS DB schema:

> CREATE VIRTUAL TABLE fts4\_metadata\_titles USING fts4(content=‘metadata\_items’, title, title\_sort, original\_title)

So, it’s populated from the title, title\_sort, and original\_title columns of the metadata\_items table.

---

_[View the full topic](https://forums.plex.tv/t/dbrepair-development/822684)._
