Skip to content

Commit 133c977

Browse files
authored
fix(cli): allow --performance small for query run and run-sql (#54)
1 parent a616e5d commit 133c977

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Manage and execute Dune queries.
3535
| `query get <query-id>` | Get a saved query's details and SQL |
3636
| `query update <query-id> [--name] [--sql] [--description] [--private] [--tags]` | Update an existing query |
3737
| `query archive <query-id>` | Archive a saved query |
38-
| `query run <query-id> [--param key=value] [--performance medium\|large] [--limit] [--timeout] [--no-wait]` | Execute a saved query and display results |
39-
| `query run-sql --sql <sql> [--param key=value] [--performance medium\|large] [--limit] [--timeout] [--no-wait]` | Execute raw SQL directly |
38+
| `query run <query-id> [--param key=value] [--performance small\|medium\|large] [--limit] [--timeout] [--no-wait]` | Execute a saved query and display results |
39+
| `query run-sql --sql <sql> [--param key=value] [--performance small\|medium\|large] [--limit] [--timeout] [--no-wait]` | Execute raw SQL directly |
4040

4141
### `dune execution`
4242

cmd/query/helpers.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ func parseQueryID(arg string) (int, error) {
2222

2323
func parsePerformance(cmd *cobra.Command) (string, error) {
2424
performance, _ := cmd.Flags().GetString("performance")
25-
if performance != "medium" && performance != "large" {
26-
return "", fmt.Errorf("invalid performance tier %q: must be \"medium\" or \"large\"", performance)
25+
if performance != "small" && performance != "medium" && performance != "large" {
26+
return "", fmt.Errorf(
27+
"invalid performance tier %q: must be \"small\", \"medium\" or \"large\"",
28+
performance,
29+
)
2730
}
2831
return performance, nil
2932
}

cmd/query/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func newRunCmd() *cobra.Command {
3535
}
3636

3737
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")
38-
cmd.Flags().String("performance", "medium", `engine size for the execution: "medium" (default) or "large"; credits are consumed based on actual compute resources used`)
38+
cmd.Flags().String("performance", "medium", `engine size for the execution: "small", "medium" (default) or "large"; credits are consumed based on actual compute resources used`)
3939
cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all available rows)")
4040
cmd.Flags().Bool("no-wait", false, "submit the execution and exit immediately, printing only the execution ID and state")
4141
cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out")

cmd/query/run_sql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func newRunSQLCmd() *cobra.Command {
3636
cmd.Flags().String("sql", "", "the SQL query text in DuneSQL dialect (required)")
3737
_ = cmd.MarkFlagRequired("sql")
3838
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")
39-
cmd.Flags().String("performance", "medium", `engine size for the execution: "medium" (default) or "large"; credits are consumed based on actual compute resources used`)
39+
cmd.Flags().String("performance", "medium", `engine size for the execution: "small", "medium" (default) or "large"; credits are consumed based on actual compute resources used`)
4040
cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all available rows)")
4141
cmd.Flags().Bool("no-wait", false, "submit the execution and exit immediately, printing only the execution ID and state")
4242
cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out")

0 commit comments

Comments
 (0)