[go: up one dir, main page]

Skip to content
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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

thruflo
Copy link
Contributor
@thruflo thruflo commented Nov 26, 2024

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 by ctl+c to stop and also from forgetting to run pnpm backend:down.

So ... as a systemic solution, I've updated the example-backend:up script in the root package.json to always run example-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.

Copy link
Contributor

@alco
Copy link
Member
alco commented Nov 27, 2024

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.

@thruflo
Copy link
Contributor Author
thruflo commented Nov 28, 2024

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?

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.

2 participants