Skip to content

Commit

Permalink
Add config track_query_stats (#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix authored Nov 27, 2024
1 parent c9104a5 commit 45187bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/commands/configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ pub async fn configure(
C::Set(Set {
parameter: S::WarnOldScoping(ConfigStr { value }),
}) => set(cli, "warn_old_scoping", None, value).await,
C::Set(Set {
parameter: S::TrackQueryStats(ConfigStr { value }),
}) => set(cli, "track_query_stats", None, value).await,
C::Reset(Res { parameter }) => {
use crate::commands::parser::ConfigParameter as C;
let name = match parameter {
Expand Down Expand Up @@ -236,6 +239,7 @@ pub async fn configure(
C::CurrentEmailProviderName => "current_email_provider_name",
C::SimpleScoping => "simple_scoping",
C::WarnOldScoping => "warn_old_scoping",
C::TrackQueryStats => "track_query_stats",
};
let (status, _warnings) = cli
.execute(&format!("CONFIGURE INSTANCE RESET {name}"), &())
Expand Down
5 changes: 5 additions & 0 deletions src/commands/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ pub enum ValueParameter {

/// Whether to warn when depending on old scoping behavior.
WarnOldScoping(ConfigStr),

/// Select what queries are tracked in sys::QueryStats.
TrackQueryStats(ConfigStr),
}

#[derive(clap::Subcommand, Clone, Debug)]
Expand Down Expand Up @@ -665,6 +668,8 @@ pub enum ConfigParameter {
SimpleScoping,
/// Whether to warn when depending on old scoping behavior.
WarnOldScoping,
/// Select what queries are tracked in sys::QueryStats.
TrackQueryStats,
}

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

0 comments on commit 45187bf

Please sign in to comment.