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

fix: enable connection to custom database name other than 'postgres' #254

Merged
merged 2 commits into from
Jan 21, 2024

Conversation

w3b6x9
Copy link
Member

@w3b6x9 w3b6x9 commented Jan 13, 2024

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

I can only connect to the postgres database when connecting via Supavisor pooler.

What is the new behavior?

I can connect to another database other than postgres database.

Additional context

This addresses the GH issue Supavisor forces request to "postgres" database even when other database is specified #234.

While this solution enables connecting to other database, that's not postgres database, it presents other problems.

Here are some things that should be tackled alongside this change for completeness:

  1. As Supavisor currently stands, this change enables listening to other database when the tenant has no existing local pool. However, if tenant wants to listen to other database then postgres database then it will default to other database. Whichever database a tenant connects to first will be the default one.
    2. Supavisor will continuously attempt to connect to a database even when that database doesn't exist. However, the client doesn't get the proper error feedback that database doesn't exist. See screen recording:

Spun this out into its own issue: #257

Screen.Recording.2024-01-12.at.17.30.06.mov

@w3b6x9 w3b6x9 force-pushed the fix/custom-db-name branch 6 times, most recently from 2a36649 to b161ed5 Compare January 17, 2024 03:09
@w3b6x9 w3b6x9 marked this pull request as ready for review January 17, 2024 03:09
@w3b6x9 w3b6x9 requested a review from abc3 January 17, 2024 03:09
@w3b6x9 w3b6x9 changed the title [WIP] fix: enable connection to custom database name other than 'postgres' fix: enable connection to custom database name other than 'postgres' Jan 17, 2024
@w3b6x9 w3b6x9 force-pushed the fix/custom-db-name branch 5 times, most recently from a208b85 to a80901d Compare January 17, 2024 23:02
lib/supavisor_web/ws_proxy.ex Outdated Show resolved Hide resolved
@abc3
Copy link
Member

abc3 commented Jan 18, 2024

legend 🔥

@abc3 abc3 merged commit 5b55a8a into main Jan 21, 2024
2 checks passed
@abc3 abc3 deleted the fix/custom-db-name branch January 21, 2024 09:44
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