From 66aed51e319978fbe46a9d3b27bc35293ff1712d Mon Sep 17 00:00:00 2001 From: Pratik Jadhav Date: Wed, 30 Sep 2026 16:10:36 +0530 Subject: [PATCH] Add dataset schema command --- README.md | 2 + cmd/agent.go | 1 + cmd/agent_test.go | 2 +- cmd/dataset_schema.go | 97 ++++++++++++++++++++++++++++++++++++++ cmd/dataset_schema_test.go | 75 +++++++++++++++++++++++++++++ main.go | 1 + 6 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 cmd/dataset_schema.go create mode 100644 cmd/dataset_schema_test.go diff --git a/README.md b/README.md index 5380501..5ee79f4 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,7 @@ pb promql active-queries # Datasets pb dataset list pb dataset info +pb dataset schema pb dataset add pb dataset remove @@ -353,6 +354,7 @@ Commands that support `-o json` return structured output: pb status -o json pb profile list -o json pb dataset list -o json +pb dataset schema -o json pb sql list -o json pb sql run "SELECT count(*) FROM backend" --from=1h --output json pb promql run "up" --dataset otel_metrics --instant --output json diff --git a/cmd/agent.go b/cmd/agent.go index 9b4805a..31d0dd0 100644 --- a/cmd/agent.go +++ b/cmd/agent.go @@ -107,6 +107,7 @@ func newAgentManifest() agentManifest { {Command: "pb profile list -o json", Description: "List locally configured profiles without credentials", Scope: "local", Mutates: false, RequiresProfile: false, Constraints: []string{"Requires the local pb config file"}}, {Command: "pb dataset list -o json", Description: "List datasets", Scope: "server", Mutates: false, RequiresProfile: true}, {Command: "pb dataset info -o json", Description: "Read dataset statistics and configuration", Scope: "server", Mutates: false, RequiresProfile: true}, + {Command: "pb dataset schema -o json", Description: "Read dataset field names and types", Scope: "server", Mutates: false, RequiresProfile: true}, {Command: "pb user list -o json", Description: "List users and their roles", Scope: "server", Mutates: false, RequiresProfile: true}, {Command: "pb role list -o json", Description: "List roles and privileges", Scope: "server", Mutates: false, RequiresProfile: true}, {Command: "pb sql run \"