SQLite Forum

Allow only SELECT statements in a read-write database (is EXPLAIN a good practice?)
Login
Others have already posted two widely-used solutions.  However, a good response to your post depends on which parts of your software you trust.

You might like to have the host application open two different connections to the database: one normal one which it uses to to its own work, and another, read-only one, which it passes to the plugin.  That way the plugin does not need to know where the database file is (no need to understand home folders or directory structures), and it cannot write to the database because it has only a read-only connection.