⚡️ Describe the Bug
In api/db/database.py, the SQLAlchemy engine is created with echo=True hardcoded on line 7. This causes every SQL query to be printed to stdout on every API request, making terminal output really noisy and hard to read when trying to debug other things.
👣 Steps to Reproduce
- Initialize the database with
python -m api.db.init_db
- Start the API with
uvicorn api.main:app --reload
- Hit any endpoint, e.g.
POST /templates/create
- Check terminal — raw SQL statements like
BEGIN, INSERT INTO template ..., COMMIT flood the output
📉 Expected Behavior
SQL echo should be off by default. Developers should be able to toggle it on when needed for debugging, not have it always dumping queries to stdout.
🖥️ Environment Information
- OS: macOS
- Docker/Compose Version: Docker 27.x / Compose v2
- Ollama Model used: mistral
📸 Screenshots/Logs
engine = create_engine(
DATABASE_URL,
echo=True, # hardcoded, no way to toggle off
connect_args={"check_same_thread": False},
)
⚡️ Describe the Bug
In api/db/database.py, the SQLAlchemy engine is created with
echo=Truehardcoded on line 7. This causes every SQL query to be printed to stdout on every API request, making terminal output really noisy and hard to read when trying to debug other things.👣 Steps to Reproduce
python -m api.db.init_dbuvicorn api.main:app --reloadPOST /templates/createBEGIN,INSERT INTO template ...,COMMITflood the output📉 Expected Behavior
SQL echo should be off by default. Developers should be able to toggle it on when needed for debugging, not have it always dumping queries to stdout.
🖥️ Environment Information
📸 Screenshots/Logs