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

Add Support for Specifying Database Schema via Environment Variable #726

Open
somnath157 opened this issue May 24, 2024 · 5 comments
Open

Comments

@somnath157
Copy link

I am trying to connect to an external database and have successfully done so by defining the PACT_BROKER_DATABASE_URL. However, the tables are being created under the public schema of the database. Since this database is used by multiple applications, I would like to have these tables under a specific schema for Pact Broker.

I couldn't find any way to achieve this using an environment variable. This seems like a common scenario and should ideally be controllable via an environment variable.

@mefellows
Copy link
Member

mefellows commented May 31, 2024

The database URL can contain the schema you want to deploy it to, e.g.

postgres://user:pass@host:5432/dbname

Is this not what you need?

@mefellows
Copy link
Member

Ah yes, schemas != databases.

@mefellows
Copy link
Member

If the issue is logical separation, does multiple databases not solve the problem? I.e. the Pact Broker database should be separate to whatever else is on the postgres cluster. My understanding is that a schema is lower in the hierarchy than database. So it might be "public", but it's only public within the database itself.

@somnath157
Copy link
Author

New DB will solve the problem of separation from application DB. But still there should be a way to define schema under that DB.

@YOU54F YOU54F transferred this issue from pact-foundation/pact-broker-docker Sep 27, 2024
@YOU54F
Copy link
Member

YOU54F commented Sep 27, 2024

moved to pact_broker repo, as the pact-broker-docker repo serves to only have additional code for dockerisation

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

No branches or pull requests

3 participants