-
Notifications
You must be signed in to change notification settings - Fork 86
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
Separate the DB configuration #3198
Conversation
@@ -54,6 +54,10 @@ pub struct Arguments { | |||
#[clap(long, env, default_value = "postgresql://")] | |||
pub db_url: Url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be removed once the config is migrated to the new one.
@@ -40,6 +40,10 @@ pub struct Arguments { | |||
#[clap(long, env, default_value = "postgresql://")] | |||
pub db_url: Url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
fc2a04e
to
0a34b0c
Compare
0a34b0c
to
ff72371
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason of doing this is to add an extra layer of safety handing the DB credentials.
Could you provide more details how this gives us extra safety?
Also why is a change in the services repo needed? Wouldn't it be sufficient to handle these things separately in the infra repo and then assemble the individual parts to a single URL?
#[derive(Clone, clap::Parser)] | ||
pub struct Db { | ||
/// Base Url of the Postgres database | ||
pub db_base_url: Option<Url>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this URL non Option
with a default. TODO after the configuration is migrated to the new one.
impl Db { | ||
/// Returns the DB URL with credentials | ||
/// Returns `None` if the URL is not configured | ||
pub fn to_url(&self) -> Option<Url> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the configuration is changed, this will return directly an Url
Description
Separate the DB configuration into base URL, user and password.
The reason of doing this is to add an extra layer of safety handing the DB credentials.
How to test