require-sqlite-blocks-pg-for-guarded-commands

IN premise

`_require_sqlite` enforces that certain subcommands (e.g., `hash-sources`) cannot run against a Postgres backend, checking both CLI flags and environment variables and calling `sys.exit()` if PG is detected

Summary

Certain subcommands like hash-sources are hardcoded to only work with SQLite. The _require_sqlite function acts as a guard that checks both command-line flags and environment variables for any sign of a Postgres connection, and kills the process immediately if one is found. This means these commands can never accidentally run against a production Postgres database, but it also means any future Postgres support for those commands requires explicitly removing or updating this guard.

Details

Sourceentries/2026/05/11/tests-test_pg_dispatch.md