Menu

Miktam Bible | Part 1 — Offline-First: SQLite, FTS5 and Open Bible Data
📰

Miktam Bible | Part 1 — Offline-First: SQLite, FTS5 and Open Bible Data

DEV Community: reactnative·Ai2th·about 2 hours ago
#TFgbNxfz
#devtoreactnative#devto#dev#null#miktam
Reading 0:00
15s threshold

Ai2th

Posted on Nov 15

Edited on Nov 15

"Offline" is easy to promise and hard to deliver. This part covers how Miktam Bible stores Scripture so that reading and searching never need the network.

🗄️ One translation, one SQLite file

Each translation is a standalone SQLite database with a simple schema:

CREATE TABLE books ( book_number INTEGER PRIMARY KEY , name TEXT NOT NULL , abbreviation TEXT NOT NULL , testament TEXT NOT NULL CHECK ( testament IN ( 'OT' , 'NT' ) ) , total_chapters INTEGER NOT NULL ) ;

CREATE TABLE verses ( id INTEGER PRIMARY KEY AUTOINCREMENT , book_number INTEGER NOT NULL , chapter INTEGER NOT NULL , verse_number INTEGER NOT NULL , text TEXT NOT NULL , UNIQUE ( book_number , chapter , verse_number ) ) ;

CREATE VIRTUAL TABLE verses_fts USING fts5 ( text , content = verses , content_rowid = id ) ;

Enter fullscreen mode

Exit fullscreen mode

The verses_fts table is SQLite's FTS5 full-text index.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.