STEPBible / BibleEngine

General purpose library for powering JavaScript Bible projects
44 stars 9 forks source link

Fix Expo migration issue caused by FTS5 extension #210

Closed danbenn closed 11 months ago

danbenn commented 12 months ago

Why

@troyhonegger and I ran into an issue when running the new bibleengine migrations on our existing database. Expo doesn't support the FTS5 extension (sadly!) so the existing set of sqlite migrations doesn't work.

How We Tested

Haven't tested this PR yet with Expo, but wanted to get feedback on it!

danbenn commented 11 months ago

@chriswep thanks for the feedback, totally agree that it's better to not create a new migration lane for this. Will update the PR to add an exclusion for the expo driver type, when running FTS5! Or even more generalized, I could run a query like:

SELECT name FROM sqlite_master WHERE type='module' AND name='fts5'

Will close the PR for now and re-open when its ready

danbenn commented 11 months ago

Sadly the above query, generated by chatgpt, is just a hallucination! There is no easily portable way, that I could find, to accurately detect the availability of FTS5.

In lieu of this, I just added a try/catch and some logging to the call to create a virtual table bible_search