bubbletui

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectionFormAborted = errors.New("connection form exited with ctrl+c")

Functions

func Run added in v0.42.0

func Run() (command.Options, error)

Run function is the main method called to run the database profiles menu.

Types

type ConnectModel added in v0.42.0

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

ConnectModel struct is the main model for the connect feature. Manages the list and the spinner sub-models, keeps track of the app state, and stores the profiles to be returned to the main dblab app.

func (*ConnectModel) Init added in v0.42.0

func (m *ConnectModel) Init() tea.Cmd

Init method starts with the spinner and fetching the profiles asynchronously.

func (*ConnectModel) Update added in v0.42.0

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

Update method manages four different events: Windows re-size to re-calculate the size of the terminal, ctrl+c to exit the form, ctrl+d to delete a profile from the config file, enter to connect to a database profile. It also manages async messages and the menu state.

func (*ConnectModel) View added in v0.42.0

func (m *ConnectModel) View() tea.View

View method shows the spinner if the data is loading, and the list of profiles if the data is already fetched from the config file.

type DBGraphTreeBuilderProvider added in v0.39.0

type DBGraphTreeBuilderProvider struct{}

func (*DBGraphTreeBuilderProvider) Children added in v0.39.0

func (DBGraphTreeBuilderProvider) ID added in v0.39.0

func (*DBGraphTreeBuilderProvider) Name added in v0.39.0

type Editor added in v0.38.0

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

func NewEditor added in v0.38.0

func NewEditor(kb *command.TUIKeyMap) Editor

func (*Editor) Blur added in v0.38.0

func (e *Editor) Blur()

func (*Editor) Focus added in v0.38.0

func (e *Editor) Focus() tea.Cmd

func (Editor) Init added in v0.38.0

func (e Editor) Init() tea.Cmd

func (*Editor) SetHeight added in v0.38.0

func (e *Editor) SetHeight(h int)

func (*Editor) SetWidth added in v0.38.0

func (e *Editor) SetWidth(w int)

func (Editor) Update added in v0.38.0

func (e Editor) Update(msg tea.Msg) (Editor, tea.Cmd)

func (Editor) View added in v0.38.0

func (e Editor) View() tea.View

type MetadataPanel added in v0.41.0

type MetadataPanel interface {
	tea.Model
}

type Mode added in v0.38.0

type Mode int
const (
	NormalMode Mode = iota
	InsertMode
)

type Model

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

func NewModel

func NewModel(c *client.Client, kb *command.TUIKeyMap) (*Model, error)

NewModel returns a pointer to the main dblab bubbletea model. It also buids the sub-models, along with styling and the app title. If DBLAB_DEBUG is set, the constructor function will create a messages.log file to log bubbletui events.

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) Run

func (m *Model) Run() error

func (Model) Update

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

func (Model) View

func (m Model) View() tea.View

type ResultSet added in v0.38.0

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

func NewResultSet added in v0.38.0

func NewResultSet(kb *command.TUIKeyMap) ResultSet

func (*ResultSet) Blur added in v0.38.0

func (r *ResultSet) Blur()

func (*ResultSet) Focus added in v0.38.0

func (r *ResultSet) Focus()

func (ResultSet) Init added in v0.38.0

func (r ResultSet) Init() tea.Cmd

func (*ResultSet) SetSize added in v0.38.0

func (r *ResultSet) SetSize(w, h int)

func (ResultSet) Update added in v0.38.0

func (r ResultSet) Update(msg tea.Msg) (ResultSet, tea.Cmd)

func (ResultSet) View added in v0.38.0

func (r ResultSet) View() tea.View

type SidebarViewport added in v0.38.0

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

func NewSidebarViewport added in v0.38.0

func NewSidebarViewport(ctx context.Context, c *client.Client, kb *command.TUIKeyMap) (SidebarViewport, error)

func (SidebarViewport) Init added in v0.38.0

func (s SidebarViewport) Init() tea.Cmd

func (*SidebarViewport) SetSize added in v0.38.0

func (s *SidebarViewport) SetSize(w, h int)

func (SidebarViewport) Update added in v0.38.0

func (s SidebarViewport) Update(msg tea.Msg) (SidebarViewport, tea.Cmd)

func (SidebarViewport) View added in v0.38.0

func (s SidebarViewport) View() string

type TablePanel added in v0.41.0

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

func (*TablePanel) Init added in v0.41.0

func (t *TablePanel) Init() tea.Cmd

func (*TablePanel) Update added in v0.41.0

func (t *TablePanel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*TablePanel) View added in v0.41.0

func (t *TablePanel) View() tea.View

type TextPanel added in v0.41.0

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

func (*TextPanel) Init added in v0.41.0

func (t *TextPanel) Init() tea.Cmd

func (*TextPanel) SetContent added in v0.41.0

func (t *TextPanel) SetContent(content string)

func (*TextPanel) Update added in v0.41.0

func (t *TextPanel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*TextPanel) View added in v0.41.0

func (t *TextPanel) View() tea.View

Jump to

Keyboard shortcuts

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