SQLite Forum

Feature request: Dynamically execute SQL from shell
Login
This has been previously considered but was rejected.  One of the reasons was that it would be very difficult to protect against exploits which involve editing the database to include harmful commands.  Such exploits might not only delete/change the database but also influence what the program accessing it did.

You might want to check out

<https://sqlite.org/cli.html#database_content_self_tests>

which can do something like what you want.  This works only in the command line shell for SQLite (which can be scripted from your OS shell).  It will not influence any program which just calls the SQLite API.