Documentation
¶
Overview ¶
Package cloudquery is the orchestration layer for SafeDep Cloud's SQL query service. It owns the gRPC client wiring, the proto-to-Go boundary translation, and the value types that command code consumes.
Command packages depend on the small interfaces declared here, not on the gRPC types or proto messages. Tests substitute fakes for the interfaces; production wiring uses Service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶ added in v0.1.5
Column is one result column with its server-declared type. Type is the ColumnType name with the COLUMN_TYPE_ prefix stripped (e.g. STRING, INT).
type ExecInput ¶
ExecInput is the user-facing payload for a SQL execution. Validation is the caller's responsibility: orchestration trusts what it receives. PageToken empty means "first page"; non-empty resumes a prior response.
type ExecResult ¶
type ExecResult struct {
Columns []Column
Rows []Row
NextPage string
GeneratedAt time.Time
Stats Stats
}
ExecResult is the materialised query response in a presentation-friendly shape. Columns is the ordered set of columns the server returned.
type ExecRunner ¶
type ExecRunner interface {
Exec(ctx context.Context, in ExecInput) (*ExecResult, error)
}
ExecRunner is the contract a query executor satisfies.
type JoinEdge ¶ added in v0.1.5
JoinEdge is an advertised join relationship between two tables. Cardinality is the server string verbatim (one_to_one, one_to_many, many_to_one).
type Row ¶
Row is one decoded row. Values are typed natives (string, float64, bool, nil). Unknown structpb kinds are rendered as their string form so callers do not have to handle proto types directly.
type Schema ¶
type Schema struct {
Tables []SchemaTable
Edges []JoinEdge
Usage Usage
}
Schema is the full SQL schema served by the control plane.
type SchemaColumn ¶
type SchemaColumn struct {
Name string
Type string
Description string
Selectable bool
Filterable bool
Groupable bool
Aggregatable bool
Indexed bool
ReferenceURL string
EnumValues []EnumValue
}
SchemaColumn describes one column inside a table.
type SchemaFetcher ¶
SchemaFetcher is the contract a schema reader satisfies.
type SchemaTable ¶
type SchemaTable struct {
Name string
Description string
Columns []SchemaColumn
TimeColumn string
TimeWindowMaxDays int64
}
SchemaTable describes one queryable table.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the production implementation backed by a control-plane gRPC connection. Command code accepts the small interfaces in this file (ExecRunner, SchemaFetcher) so unit tests can pass stubs.
func NewService ¶
func NewService(conn *grpc.ClientConn) *Service
NewService wraps a control-plane gRPC connection in a Service.