Skip to content

Commit

Permalink
Add config support for auto_rebuild_query_cache (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix authored Feb 29, 2024
1 parent b95f4c9 commit da67782
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ pub async fn configure(cli: &mut Connection, _options: &Options,
&format!("CONFIGURE INSTANCE SET cors_allow_origins := {{{values}}}"), &()).await?);
Ok(())
}
C::Set(Set { parameter: S::AutoRebuildQueryCache(ConfigStr { value }) }) => {
set(cli, "auto_rebuild_query_cache", None, value).await
}
C::Reset(Res { parameter }) => {
use crate::commands::parser::ConfigParameter as C;
let name = match parameter {
Expand All @@ -131,6 +134,7 @@ pub async fn configure(cli: &mut Connection, _options: &Options,
C::ApplyAccessPolicies => "apply_access_policies",
C::AllowUserSpecifiedId => "allow_user_specified_id",
C::CorsAllowOrigins => "cors_allow_origins",
C::AutoRebuildQueryCache => "auto_rebuild_query_cache",
};
print::completion(&cli.execute(
&format!("CONFIGURE INSTANCE RESET {name}"),
Expand Down
7 changes: 6 additions & 1 deletion src/commands/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ pub enum ValueParameter {
AllowUserSpecifiedId(ConfigStr),

/// Web origins that are allowed to send HTTP requests to this server.
CorsAllowOrigins(ConfigStrs)
CorsAllowOrigins(ConfigStrs),

/// Recompile all cached queries on DDL if enabled.
AutoRebuildQueryCache(ConfigStr),
}

#[derive(clap::Subcommand, Clone, Debug)]
Expand Down Expand Up @@ -564,6 +567,8 @@ pub enum ConfigParameter {
AllowUserSpecifiedId,
/// Reset cors_allow_origins to an empty set
CorsAllowOrigins,
/// Reset auto_rebuild_query_cache to `true`
AutoRebuildQueryCache,
}

#[derive(clap::Args, Clone, Debug)]
Expand Down

0 comments on commit da67782

Please sign in to comment.