app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClipboardMsg

type ClipboardMsg struct {
	Text string
	OK   bool
}

ClipboardMsg is sent after a clipboard copy attempt.

type ColInfo

type ColInfo = struct {
	CID     int
	Name    string
	Type    string
	NotNull bool
	PK      bool
	Dflt    sql.NullString
}

ColInfo is re-exported from the db package for use in the model.

type Components

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

Components provides reusable styled UI components.

func NewComponents

func NewComponents(cl theme.Colors) Components

NewComponents creates a new Components instance with the given theme.

func (Components) Breadcrumb

func (c Components) Breadcrumb(items []string) string

Breadcrumb renders breadcrumb navigation.

func (Components) Card

func (c Components) Card(title string, content string) string

Card renders a card-like container with content.

func (Components) Divider

func (c Components) Divider() string

Divider renders a horizontal divider.

func (Components) EmptyState

func (c Components) EmptyState(message string) string

EmptyState renders an empty state message.

func (Components) ErrorBox

func (c Components) ErrorBox(title string, content string) string

ErrorBox renders an error box.

func (Components) FocusIndicator

func (c Components) FocusIndicator(text string) string

FocusIndicator renders a focus indicator for active elements.

func (Components) Header

func (c Components) Header(title string, subtitle string) string

Header renders a styled header section.

func (Components) HelpBar

func (c Components) HelpBar(hints []string) string

HelpBar renders a contextual help bar with key hints.

func (Components) InfoBox

func (c Components) InfoBox(title string, content string) string

InfoBox renders an informational box.

func (Components) LoadingSpinner

func (c Components) LoadingSpinner(text string) string

LoadingSpinner renders a loading spinner with text.

func (Components) Section

func (c Components) Section(title string, content string) string

Section renders a section with a title and content.

func (Components) ShortText

func (c Components) ShortText(text string, max int) string

ShortText truncates text with ellipsis if too long.

func (Components) StatusBadge

func (c Components) StatusBadge(text string, status string) string

StatusBadge renders a status badge.

func (Components) WarningBox

func (c Components) WarningBox(title string, content string) string

WarningBox renders a warning box.

type DataLoaded

type DataLoaded struct {
	Cols     []string
	Rows     [][]string
	Total    int
	TblName  string
	Page     int
	ScanErrs int
}

DataLoaded is sent when table data has been loaded from the database.

type Dialog

type Dialog struct {
	Kind   DialogKind
	Title  string
	Body   string
	Input  string
	Cursor int
	Data   interface{}
}

Dialog holds the state for an active dialog overlay.

type DialogKind

type DialogKind int

DialogKind represents the type of dialog shown to the user.

const (
	DlgNone DialogKind = iota
	DlgConfirm
	DlgEdit
	DlgExport
	DlgAddRow
	DlgImportFmt
	DlgImportPath
	DlgConfirmQuery
)

type ErrMsg

type ErrMsg struct{ Err error }

ErrMsg wraps an error for the Bubble Tea update loop.

type FKInfo

type FKInfo = struct {
	ID, Table, From, To string
}

FKInfo is re-exported from the db package for use in the model.

type Model

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

Model is the main Bubble Tea model for the app.

func New

func New(dsn string) Model

New creates a new Model by opening the given database.

func (Model) Init

func (m Model) Init() tea.Cmd

Init returns the initial command.

func (Model) Update

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

Update handles the top-level Bubble Tea update dispatch.

func (Model) View

func (m Model) View() string

type NotifyMsg

type NotifyMsg struct{ Msg string }

NotifyMsg carries a user-facing notification string.

type QueryResult

type QueryResult struct {
	Cols     []string
	Rows     [][]string
	Affected int64
	ScanErrs int
}

QueryResult is sent after executing a SQL query.

type TickMsg

type TickMsg time.Time

TickMsg is sent on each timer tick for spinner animation.

type ViewMode

type ViewMode int

ViewMode represents the current UI view.

const (
	ViewTables ViewMode = iota
	ViewData
	ViewSchema
	ViewQuery
	ViewSearch
	ViewStats
	ViewQueryLog
	ViewDetail
)

Jump to

Keyboard shortcuts

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