The output will show 1, 2, or 0, depending on how SQLite was compiled.
1 means SQLite is compiled in Serialized mode (SQLITE_THREADSAFE=1). Default
2 means SQLite is compiled in Multi-thread mode (SQLITE_THREADSAFE=2).
0 means SQLite is compiled in Single-thread mode (SQLITE_THREADSAFE=0).
If use SQLITE_THREADSAFE=2 (multithreaded) you have to make sure that each thread uses its own database connection. Sharing a single database connecgtion amongst multiple threads isn't safe.
If use SQLITE_THREADSAFE=1 (serialized) you can even safely reuse a single databse connection amongst multiple threads.
Proposal Details
Sqlite version
To ensure the consistency of local and server data import, use the same Sqlite version 3.46.1
Corresponding source code
Enable Sqlite multithread mode
Sqlite must be compiled first and then enable multithread mode.
Configure the Build with SQLITE_THREADSAFE=2
How to Check SQLITE_THREADSAFE:
Run a Small C Program check_threadsafe.c
Compile and run this program:
Expect output
The output will show 1, 2, or 0, depending on how SQLite was compiled.
If use SQLITE_THREADSAFE=2 (multithreaded) you have to make sure that each thread uses its own database connection. Sharing a single database connecgtion amongst multiple threads isn't safe. If use SQLITE_THREADSAFE=1 (serialized) you can even safely reuse a single databse connection amongst multiple threads.