metaquery

package
v0.17.0-dev.10 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Complete

func Complete(input *CompleterInput) []prompt.Suggest

Complete returns completions for metaqueries.

func Handle

func Handle(ctx context.Context, input *HandlerInput) error

Handle handles a metaquery execution from the interactive client

func IsMetaQuery

func IsMetaQuery(query string) bool

IsMetaQuery :: returns true if the query is a metaquery, false otherwise

func PromptSuggestions

func PromptSuggestions() []prompt.Suggest

PromptSuggestions :: Returns a list of the suggestions for go-prompt

Types

type CompleterInput

type CompleterInput struct {
	Query            string
	TableSuggestions []prompt.Suggest
}

CompleterInput is a struct defining input data for the metaquery completer

type HandlerInput

type HandlerInput struct {
	Query       string
	Executor    QueryExecutor
	Schema      *schema.Metadata
	Connections *steampipeconfig.ConnectionDataMap
	Prompt      *prompt.Prompt
	ClosePrompt func()
}

HandlerInput :: input interface for the metaquery handler

type PromptControl

type PromptControl interface {
	Clear()
	Close()
}

type QueryExecutor

type QueryExecutor interface {
	SetRequiredSessionSearchPath(context.Context) error
	GetCurrentSearchPath(context.Context) ([]string, error)
	CacheOn(context.Context) error
	CacheOff(context.Context) error
	CacheClear(context.Context) error
}

QueryExecutor :: this is a container interface which allows us to call into the db/Client object

type ValidationResult

type ValidationResult struct {
	Err       error
	ShouldRun bool
	Message   string
}

ValidationResult :: response for Validate

func Validate

func Validate(query string) ValidationResult

Validate :: validate a full metaquery along with arguments - we can return err & validationResult

Jump to

Keyboard shortcuts

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