From 854691dc1ad0323797d406dcca7488069cab473a Mon Sep 17 00:00:00 2001 From: Charis Date: Tue, 21 Apr 2026 14:53:32 +0300 Subject: [PATCH] fix(cli): allow --performance small for query run and run-sql --- README.md | 4 ++-- cmd/query/helpers.go | 7 +++++-- cmd/query/run.go | 2 +- cmd/query/run_sql.go | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c305c4a..480ddb5 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ Manage and execute Dune queries. | `query get ` | Get a saved query's details and SQL | | `query update [--name] [--sql] [--description] [--private] [--tags]` | Update an existing query | | `query archive ` | Archive a saved query | -| `query run [--param key=value] [--performance medium\|large] [--limit] [--timeout] [--no-wait]` | Execute a saved query and display results | -| `query run-sql --sql [--param key=value] [--performance medium\|large] [--limit] [--timeout] [--no-wait]` | Execute raw SQL directly | +| `query run [--param key=value] [--performance small\|medium\|large] [--limit] [--timeout] [--no-wait]` | Execute a saved query and display results | +| `query run-sql --sql [--param key=value] [--performance small\|medium\|large] [--limit] [--timeout] [--no-wait]` | Execute raw SQL directly | ### `dune execution` diff --git a/cmd/query/helpers.go b/cmd/query/helpers.go index acd5f85..9ac3c7c 100644 --- a/cmd/query/helpers.go +++ b/cmd/query/helpers.go @@ -22,8 +22,11 @@ func parseQueryID(arg string) (int, error) { func parsePerformance(cmd *cobra.Command) (string, error) { performance, _ := cmd.Flags().GetString("performance") - if performance != "medium" && performance != "large" { - return "", fmt.Errorf("invalid performance tier %q: must be \"medium\" or \"large\"", performance) + if performance != "small" && performance != "medium" && performance != "large" { + return "", fmt.Errorf( + "invalid performance tier %q: must be \"small\", \"medium\" or \"large\"", + performance, + ) } return performance, nil } diff --git a/cmd/query/run.go b/cmd/query/run.go index 026ea8b..32933da 100644 --- a/cmd/query/run.go +++ b/cmd/query/run.go @@ -35,7 +35,7 @@ func newRunCmd() *cobra.Command { } cmd.Flags().StringArray("param", nil, "typed query parameter in key=value format (repeatable); supported types: text, number (stringified, e.g. '30'), datetime (YYYY-MM-DD HH:mm:ss), enum") - cmd.Flags().String("performance", "medium", `engine size for the execution: "medium" (default) or "large"; credits are consumed based on actual compute resources used`) + cmd.Flags().String("performance", "medium", `engine size for the execution: "small", "medium" (default) or "large"; credits are consumed based on actual compute resources used`) cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all available rows)") cmd.Flags().Bool("no-wait", false, "submit the execution and exit immediately, printing only the execution ID and state") cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out") diff --git a/cmd/query/run_sql.go b/cmd/query/run_sql.go index 4e230de..7e03165 100644 --- a/cmd/query/run_sql.go +++ b/cmd/query/run_sql.go @@ -36,7 +36,7 @@ func newRunSQLCmd() *cobra.Command { cmd.Flags().String("sql", "", "the SQL query text in DuneSQL dialect (required)") _ = cmd.MarkFlagRequired("sql") cmd.Flags().StringArray("param", nil, "typed query parameter in key=value format (repeatable); supported types: text, number (stringified, e.g. '30'), datetime (YYYY-MM-DD HH:mm:ss), enum") - cmd.Flags().String("performance", "medium", `engine size for the execution: "medium" (default) or "large"; credits are consumed based on actual compute resources used`) + cmd.Flags().String("performance", "medium", `engine size for the execution: "small", "medium" (default) or "large"; credits are consumed based on actual compute resources used`) cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all available rows)") cmd.Flags().Bool("no-wait", false, "submit the execution and exit immediately, printing only the execution ID and state") cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out")