Skip to content

chore: Migrate Query CLI to use Query v2 Service#18

Open
abhisek wants to merge 4 commits into
mainfrom
chore/migrate-query-to-use-query-v2-api
Open

chore: Migrate Query CLI to use Query v2 Service#18
abhisek wants to merge 4 commits into
mainfrom
chore/migrate-query-to-use-query-v2-api

Conversation

@abhisek
Copy link
Copy Markdown
Member

@abhisek abhisek commented May 27, 2026

  • chore: Update gRPC SDK
  • chore: Migrate query cli to use Query v2 Service
  • fix: TUI for human on get schema

@safedep
Copy link
Copy Markdown

safedep Bot commented May 27, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
icon buf.build/gen/go/safedep/api/grpc/go @ v1.6.2-20260524054719-9c47eb06a4aa.1
go.mod
ok icon
ok icon
ok icon
🔗
icon buf.build/gen/go/safedep/api/protocolbuffers/go @ v1.36.11-20260524054719-9c47eb06a4aa.1
go.mod
ok icon
ok icon
ok icon
🔗
icon google.golang.org/grpc @ v1.81.0
go.mod
ok icon
ok icon
ok icon
🔗

View complete scan results →

This report is generated by SafeDep Github App

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the query CLI from the v1 QueryService to the v2 QueryService in the SafeDep gRPC SDK. The v2 API returns typed column metadata, query stats, join edges, enum values, and usage rules, so this PR expands the internal types, decoders, renderers, and tests to surface that richer schema/result information. The PR also bumps the gRPC SDK + google.golang.org/grpc versions and applies gofmt to a handful of unrelated files.

Changes:

  • Update cloudquery types/service to consume the v2 proto: typed Column/Stats, schema Edges/Usage/EnumValue/Indexed/Groupable/Aggregatable, columnTypeName helper, and removal of client-side column-set derivation (server now supplies ordered columns).
  • Extend query schema get (new --table filter, table-grouped TUI with caps codes + enum truncation + refs footnotes + joins + usage sections) and query exec (typed JSON columns, stats/footer, raised proto bounds: SQL 16000, page token 2048).
  • Bump gRPC SDK to 1.6.2-20260524054719-… and google.golang.org/grpc to 1.81.0; gofmt-only adjustments across internal/cmd/endpoint/*, internal/auth, internal/agent, internal/storage, etc.

Reviewed changes

Copilot reviewed 14 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go.mod, go.sum Bump SafeDep gRPC SDK and grpc to v1.81.0.
internal/cloudquery/types.go Add Column, Stats, EnumValue, JoinEdge, Usage; extend SchemaTable/SchemaColumn.
internal/cloudquery/service.go Switch client to v2; decode columns/stats/edges/usage/enums; add columnTypeName.
internal/cloudquery/service_test.go New tests for typed columns, schema decoding, enum mapping, and gRPC status pass-through.
internal/cmd/query/exec.go Typed JSON columns, stats, RFC3339 generated_at, TUI footer; bumps for new proto bounds.
internal/cmd/query/exec_input.go Doc-only update reflecting v2 page-token bound.
internal/cmd/query/exec_test.go Cover typed columns, stats, footer, next-page hint.
internal/cmd/query/schema.go Add --table filter, sectioned TUI with caps codes, enum truncation, refs footnote, joins, usage.
internal/cmd/query/schema_test.go Cover filtering, sectioned table render, enum truncation, time annotation, caps helpers.
docs/cmd/query-exec.md, docs/cmd/query-schema-get.md Document new output shapes, bounds, and --table flag.
internal/cmd/endpoint/, internal/auth/, internal/agent/, internal/storage/ gofmt-only whitespace adjustments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@abhisek abhisek requested a review from arunanshub May 27, 2026 10:43
arunanshub
arunanshub previously approved these changes May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants