In the code below, pathToNonDatabase is the path to a simple text file, not a real sqlite database. I was hoping for sqlite3_open to detect that, but
pathToNonDatabase
sqlite3_open
I think a pragma integrity_check could do it.