tui

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package tui implements the interactive SQL client used by `rdq tui` (and the bare `rdq` invocation since tui is the default subcommand). It is a bubbletea program: a textarea SQL editor on top, a results pane below, and a help bar at the bottom.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg Config) error

Run launches the bubbletea program with the resolved connection. It blocks until the user quits.

Types

type Config

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

Config is the minimal set of inputs the TUI needs to run. The command layer constructs this from its Globals so that internal/tui does not have to import the command package (which would create an import cycle).

type Model

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

Model is the bubbletea Model for the rdq TUI.

func (Model) Init

func (m Model) Init() tea.Cmd

Init starts the spinner ticker and kicks off an asynchronous schema fetch so the AI prompt has up-to-date table/column context when the user invokes it. The TUI does not block on the fetch; if it is still running when the user presses Ctrl+G we send a degraded prompt without schema.

func (Model) Update

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

Update is the canonical bubbletea reducer. It dispatches messages to the focused pane after handling global key bindings and async results.

func (Model) View

func (m Model) View() string

View renders the full TUI: status bar, editor, results pane, status line, and help bar. Picker / overlay states (history, model picker, ask input) take over the editor + results region while open.

Jump to

Keyboard shortcuts

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