command

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AskCmd

type AskCmd struct {
	Query string `arg:"" help:"Natural language query to convert to SQL."`
}

func (*AskCmd) Run

func (c *AskCmd) Run(globals *Globals) error

type ExecCmd

type ExecCmd struct {
	SQL    string `arg:"" optional:"" help:"SQL statement to execute. Mutually exclusive with --file."`
	File   string `short:"f" help:"Read SQL from file path. Use - for stdin."`
	Output string `short:"o" default:"table" enum:"table,json,csv" help:"Output format: table, json, or csv."`
	Yes    bool   `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

ExecCmd is the Kong struct for `rdq exec`. The stub was replaced with a one-shot runner that reuses the same engine the TUI and GUI talk to.

SQL is optional as a positional arg so users can supply it via --file instead. Mutually exclusive with --file; both empty or both set is a usage error.

The unexported seams (executeSQL, loadState, isTerminal) are intentionally left unexported: they exist only so exec_test.go can exercise every branch without hitting AWS. Production callers should never set them.

func (*ExecCmd) Run

func (c *ExecCmd) Run(globals *Globals) error

Run is the Kong entrypoint. It delegates to runExec for all real logic so tests can drive the pure function directly and observe exit codes without terminating the test binary via os.Exit.

type GUICmd

type GUICmd struct {
	Port   int  `help:"Port to listen on." short:"P" default:"8080"`
	NoOpen bool `help:"Do not open browser automatically."`
	Dev    bool `help:"Allow http://localhost:5173 as an origin so the Vite dev server can talk to this API."`
}

func (*GUICmd) Run

func (c *GUICmd) Run(globals *Globals) error

Run boots the GUI HTTP server with a graceful shutdown on SIGINT / SIGTERM. The globals struct carries any initial connection selection from the CLI layer; the SPA is still expected to call PUT /api/session to pick or confirm a destination.

type Globals

type Globals struct {
	Profile         string
	Debug           bool
	AWSConfig       aws.Config
	ClusterArn      string
	SecretArn       string
	Database        string
	BedrockModel    string
	BedrockLanguage string
}

type TUICmd

type TUICmd struct{}

func (*TUICmd) Run

func (c *TUICmd) Run(globals *Globals) error

Jump to

Keyboard shortcuts

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