show

package
v0.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package show is the show command: an object of the repo, read from its compiled AML, by the identity the semantic catalog gives it.

Index

Constants

This section is empty.

Variables

View Source
var Show = command.Define(command.Def[ShowInput, anfranode.ShowResult]{
	Name:  "show",
	Short: "Show the repo's datasets, or one dataset, with their models, fields, and metrics",
	Long: "Show the repo's datasets, or one dataset, with their models, fields, and metrics, as AQL can query them.\n\n" +
		"With no fqn, it shows the repo and every dataset in full, and with a dataset's fqn, that dataset in full. " +
		"It shows names, labels, types, roles, and AQL definitions, never SQL or tables. " +
		"Problems that affect the result come with it as diagnostics, such as a file that doesn't compile, " +
		"or a data source the repo doesn't configure.",
	ReadOnly:   true,
	Idempotent: true,
	Timeout:    2 * time.Minute,
	Needs:      func(ShowInput) command.Sidecars { return command.Sidecars{Node: true} },

	Normalize: func(in ShowInput) ShowInput {
		in.Fqn = strings.TrimSpace(in.Fqn)
		return in
	},
	Run: func(ctx context.Context, cc command.CommandContext, in ShowInput) (anfranode.ShowResult, error) {
		if err := command.RequireSidecars(cc, command.Sidecars{Node: true}); err != nil {
			return anfranode.ShowResult{}, err
		}

		fqn, typ := in.Fqn, ""
		if fqn != "" {
			typ = in.Type
		}
		sources, err := cc.ResolveDataSources()
		if err != nil {
			return anfranode.ShowResult{}, err
		}
		res, err := aml.Show(ctx, cc.Clients.Node, cc.Repo, sources, typ, fqn)
		if v, ok := refused(err); ok {
			return anfranode.ShowResult{}, apperr.EncapsulateWith(err, apperr.ValidationFailed, v.Message, apperr.Violate(v))
		}
		return res, err
	},
})

Show shows the repo, or a dataset in full.

Functions

This section is empty.

Types

type ShowInput

type ShowInput struct {
	Fqn  string `json:"fqn,omitempty" cli:"positional" doc:"the fqn of the dataset to show, the whole repo by default"`
	Type string `json:"type,omitempty" enum:"aml.dataset" default:"aml.dataset" doc:"the catalog's entity type of fqn"`
}

ShowInput is what to show, as the semantic catalog identifies it: an entity type and its fqn. No fqn: the repo.

func (ShowInput) TransformSchema

func (ShowInput) TransformSchema(_ huma.Registry, s *huma.Schema) *huma.Schema

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL