Skip to content

docs: clarify SQLite (local) vs PostgreSQL (Docker/production) defaults in .env.example and service README#220

Open
mvanhorn wants to merge 1 commit into
HKUDS:mainfrom
mvanhorn:docs/clarify-sqlite-postgres-defaults
Open

docs: clarify SQLite (local) vs PostgreSQL (Docker/production) defaults in .env.example and service README#220
mvanhorn wants to merge 1 commit into
HKUDS:mainfrom
mvanhorn:docs/clarify-sqlite-postgres-defaults

Conversation

@mvanhorn
Copy link
Copy Markdown

Summary

A new contributor can now read .env.example and service/README.md and tell, without scanning code, that SQLite is the local default and PostgreSQL is the Docker/production opt-in path.

Why this matters

In #206, @JamesVanhecke flagged that .env.example ships DATABASE_URL= (empty) alongside DB_PATH=service/server/data/clawtrader.db, with comments that don't make clear which backend is the recommended local default or whether the postgresql:// example is the intended path. Maintainer @TianyuFan0504 confirmed (2026-05-12) the intended behavior - SQLite when DATABASE_URL is empty, PostgreSQL for Docker/production - and asked to keep the issue open until the docs make that priority unambiguous.

This PR makes that priority explicit in both surfaces a new contributor lands on.

Testing

  • .env.example keys are unchanged, only comments updated, so existing local .env files keep working.
  • The new service/README.md "Database backends" section names both DB_PATH and DATABASE_URL with their roles and gives a one-line example for each.
  • service/server/database.py already implements the documented behavior (SQLite when DATABASE_URL is unset/empty, PostgreSQL otherwise), so no code changes are needed.
  • Markdown renders cleanly; no broken links.

Fixes #206

Rewrites the Database section of .env.example so the supported modes,
the default backend (SQLite via DB_PATH), and the PostgreSQL opt-in
path (set DATABASE_URL for Docker / production) are stated in order
and unambiguous. Adds a matching "Database backends" section to
service/README.md so a new contributor lands on consistent guidance
from either entry point.

No code or behavior change — service/server/database.py already
implements both paths exactly this way (SQLite when DATABASE_URL is
empty, PostgreSQL when it is set).

Refs: HKUDS#206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker setup seems inconsistent with local SQLite default configuration

1 participant