docs: clarify SQLite (local) vs PostgreSQL (Docker/production) defaults in .env.example and service README#220
Open
mvanhorn wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A new contributor can now read
.env.exampleandservice/README.mdand 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.exampleshipsDATABASE_URL=(empty) alongsideDB_PATH=service/server/data/clawtrader.db, with comments that don't make clear which backend is the recommended local default or whether thepostgresql://example is the intended path. Maintainer @TianyuFan0504 confirmed (2026-05-12) the intended behavior - SQLite whenDATABASE_URLis 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.examplekeys are unchanged, only comments updated, so existing local.envfiles keep working.service/README.md"Database backends" section names bothDB_PATHandDATABASE_URLwith their roles and gives a one-line example for each.service/server/database.pyalready implements the documented behavior (SQLite whenDATABASE_URLis unset/empty, PostgreSQL otherwise), so no code changes are needed.Fixes #206