-
Notifications
You must be signed in to change notification settings - Fork 23
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
Query remote/cloud instances for extensions. #1438
Conversation
src/portable/extension.rs
Outdated
@@ -53,27 +55,65 @@ fn get_local_instance(options: &Options) -> Result<InstanceInfo, anyhow::Error> | |||
Ok(inst) | |||
} | |||
|
|||
#[tokio::main(flavor = "current_thread")] |
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.
This seems out of place...
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.
Oh I see, this is being used to convert the function to a blocking one. I didn't know you could do this. It's not ideal -- I would recommend creating yourself a new tokio runtime and using block_on (see
Line 160 in dbe9f20
fn block_on<T>(f: impl Future<Output = anyhow::Result<T>>) -> anyhow::Result<T> { |
.unwrap_or_default(); | ||
table.add_row(row![name, version]); | ||
} | ||
table.set_titles(row!["Name", "Version"]); |
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.
Nice fix!
src/portable/extension.rs
Outdated
let extension_loader = inst.extension_loader_path()?; | ||
let output = run_extension_loader(&extension_loader, Some("--list-packages"), None::<&str>)?; | ||
let value: serde_json::Value = serde_json::from_str(&output)?; | ||
let extensions: Vec<ExtensionInfo> = (|| { |
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.
Generally it would be better to create a new function rather than define a closure and immediately execute it.
cee441b
to
e4ecf05
Compare
e4ecf05
to
70499c6
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.
LGTM!
Adds support to
egedb extension list
for remote and cloud instances.Close #1437
Running with a remote dev instance produced:
Running with a cloud instance produced: