Skip to content

Auto-clone database on branch change#4

Open
IbraheemTuffaha wants to merge 7 commits intomainfrom
auto-clone
Open

Auto-clone database on branch change#4
IbraheemTuffaha wants to merge 7 commits intomainfrom
auto-clone

Conversation

@IbraheemTuffaha
Copy link
Member

This PR adds middleware that automatically clones the database when switching git branches upon first request to the server for dev DB and test run for test DB.

Changes

  • New middleware: Automatically detects branch changes and clones the database on the first request to the new branch
  • Performance optimization: Improved current_branch lookup from 12ms to 0.01ms
  • Simplified caching: Removed parent_branch caching to avoid stale parent branch detection

I tested the solution and it works, I'm just not sure if the configs & connections are handled in the optimal way

@IbraheemTuffaha IbraheemTuffaha self-assigned this Jan 26, 2026
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.

1 participant