params

package
v0.3.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAborted = fmt.Errorf("parameter input aborted")

Functions

func CollectParameters

func CollectParameters(sql string, missingParams []string, defaults map[string]string) (map[string]string, error)

func ExtractParameters

func ExtractParameters(sql string) map[string]string

func GenerateDisplaySQL

func GenerateDisplaySQL(sql string, paramValues map[string]string) string

func GetMissingRequired

func GetMissingRequired(paramDefs, currentValues map[string]string) []string

func MapPositionalArgs

func MapPositionalArgs(sql string, positionals []string) map[string]string

func ResolveParameters

func ResolveParameters(paramDefs, cliValues map[string]string) map[string]string

func SubstituteParameters

func SubstituteParameters(sql string, paramValues map[string]string, conn db.DatabaseConnection) (string, []any, error)

func ValidateCLIValues

func ValidateCLIValues(cliValues, paramDefs map[string]string) error

func ValidateParamNames

func ValidateParamNames(paramDefs map[string]string) error

Types

type InputModel

type InputModel struct {
	// contains filtered or unexported fields
}

func NewInputModel

func NewInputModel(sql string, missingParams []string, defaults map[string]string) InputModel

func (InputModel) GetValues

func (m InputModel) GetValues() map[string]string

func (InputModel) Init

func (m InputModel) Init() tea.Cmd

func (InputModel) Update

func (m InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (InputModel) View

func (m InputModel) View() string

func (InputModel) WasAborted

func (m InputModel) WasAborted() bool

Jump to

Keyboard shortcuts

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