-
Notifications
You must be signed in to change notification settings - Fork 271
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
Ensure DB ID is set if namespaces are enabled #766
Conversation
Ok(res) => { | ||
let res = res.trim().to_string(); | ||
if res.is_empty() { | ||
bail!("{} environment variable is empty", key) | ||
} else { | ||
Ok(res) | ||
} | ||
} |
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.
If we don't trim, then it lets us slip in values containing just spaces or export LIBSQL_BOTTOMLESS_DATABASE_ID=''
. I don't think we ever want env variables to have spaces, trimming seems like a must.
@@ -155,12 +155,19 @@ impl Options { | |||
pub fn from_env() -> Result<Self> { | |||
fn env_var(key: &str) -> Result<String> { |
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.
I preemptively acked, but before we merge -- should all env_var
callsites disallow empty vars?
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.
@avinassh can you double-check before I queue this?
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.
@psarna hey, let me double check all of the vars if we are using empty vars anywhere
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.
@psarna I have double checked all, we don't expect empty variables to be set anywhere in bottomless
closes #765