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

feat(cli): add shadow database host configuration #2989

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

nzlz
Copy link

@nzlz nzlz commented Dec 19, 2024

  • Add ShadowHost config option to control shadow database connection
  • Default to Hostname if ShadowHost not set

The scenario is the following:

  • local supabase deployment, self hosted.
  • running migrations inside our own container which has supa running via docker compose.
  • attempt supabase db diff --db-url ...

This does not work since the docker running the shadow database is created on host, and 127.0.0.1 for host network is not accessible from inside our container.

In my case, i set the following in the config.toml >> shadow_host = "172.18.0.1" and now db diff works.

(open to alternative solutions!)

- Add ShadowHost config option to control shadow database connection
- Default to Hostname if ShadowHost not set
@nzlz nzlz requested a review from a team as a code owner December 19, 2024 11:08
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12411481695

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 59.736%

Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 12.9%
Totals Coverage Status
Change from base Build 12406922166: -0.008%
Covered Lines: 7657
Relevant Lines: 12818

💛 - Coveralls

@sweatybridge
Copy link
Contributor

sweatybridge commented Dec 30, 2024

This does not work since the docker running the shadow database is created on host, and 127.0.0.1 for host network is not accessible from inside our container.

The shadow db container is always created using docker host network mode, so 127.0.0.1 should resolve to your host network from inside the container. I suspect the root cause is something else.

Could you try the following and let me know if there's any error?

DOCKER_HOST=172.18.0.1 supabase db diff --db-url ...

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.

3 participants