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

Ability to set MongoDB database name #906

Closed
chriscoffee opened this issue Nov 12, 2018 · 4 comments · Fixed by #997
Closed

Ability to set MongoDB database name #906

chriscoffee opened this issue Nov 12, 2018 · 4 comments · Fixed by #997
Assignees
Labels
bug Something isn't working good first issue Great issues for new Athenians to work on! storage work to do on one or more of our storage systems

Comments

@chriscoffee
Copy link
Member

Is your feature request related to a problem? Please describe.

I deployed athens to heroku. If I wanted to use the sandbox mLab offering of mongoDB for example I'd have to take their automatically generated database name (something like heroku_aowd89adw which wouldn't be athens. athens is currently required by this storage driver implementation.

At the moment we hardcode the database name as athens and there's a TODO to make a better solution.

Describe the solution you'd like

Either creating environment variables for the database inline with our current environment variable naming or my preffered solution is reading the [/database] from mgo.ParseURL

Describe alternatives you've considered

Leave it as it'd be and force users to have athens as their database name.

Additional context

Some discussion around the subject https://gophers.slack.com/archives/C9LRAQN8N/p1542026809792000

@manugupt1 manugupt1 added bug Something isn't working good first issue Great issues for new Athenians to work on! storage work to do on one or more of our storage systems labels Nov 12, 2018
@michalpristas
Copy link
Member

I would go with this

  • use mgo to parse out db name in mongo pkg so we don't bloat config package with unnecessary dependencies
  • if info.db is not set then use newly introduced config.Mongo.DefaultDBName which is set by ENV, is not required and defaults to athens

this way we give a solution for people preferring one way or another at the same time

@chriscoffee
Copy link
Member Author

I'll take this for myself!

@ghost ghost assigned chriscoffee Nov 13, 2018
@manugupt1
Copy link
Member

@chriscoffee Are you still on this?

@chriscoffee
Copy link
Member Author

@manugupt1 yeah mate I'll put the PR in tomorrow or later tonight, just been busy recently sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Great issues for new Athenians to work on! storage work to do on one or more of our storage systems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants