Option 1. If you need option 2, you need to use multi-threaded mode, just like the text says. In single-threaded mode, the global state of sqlite functions will not be protected, and using them simultaneously in multiple threads will be a problem.
In multithreaded mode, you can use sqlite in multiple threads in one application, but you cannot share the same connection between threads at the same time.
source share