-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples: always start clean and update running instructions. #2045
base: main
Are you sure you want to change the base?
Conversation
Examples |
Wouldn't it be better to run each example in an independent Docker Compose namespace? So each will gets its own containers for Electric and the database, independent of the others. While the solution proposed in this PR solves the specific problem of starting in a clean state, it introduces other issues, such as inability to pause and resume the same example at a later time easily. |
The problem occurs when re-running the same example as much as across examples. I’d rather have the example work without weird stale data than support persistent data across restarts. Bear in mind it does print what’s happening to stdout. Is there a solution that can support the best of both worlds? |
I've been working with the examples quite a lot and I've commonly experienced stale database and disk state from running
docker compose up
in the foreground followed byctl+c
to stop and also from forgetting to runpnpm backend:down
.So ... as a systemic solution, I've updated the
example-backend:up
script in the root package.json to always runexample-backend:down
first. This means that examples always start with a clean slate and no weird / stuck table and or disk state.I also then did a pass through the example READMEs, explaining this and re-formatting the instructions a touch.