Minimal servers often have python but not the sqlite3 command line tool.
python3 -m sqlite3 app.db "SELECT count(*) FROM sqlite_master"
python3 -m sqlite3 app.db
With a statement as the second argument python runs it and exits. Without one you get an interactive prompt, and .quit or Ctrl-D leaves it. This module entry point was added in Python 3.12, so it works on Ubuntu 24.04 but not on Debian 12, which ships 3.11. The usage is python -m sqlite3 [-h] [-v] [filename] [sql], and -v prints the version of the SQLite library in use. It is a small shell, not a replacement for the full sqlite3 tool, so install that one if you need its extra features.
Further reading: sqlite3 documentation