interactive

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunInteractivePrompt

func RunInteractivePrompt(ctx context.Context, db *database.DuckDb) error

RunInteractivePrompt starts the interactive query prompt

Types

type AfterPromptCloseAction

type AfterPromptCloseAction int
const (
	AfterPromptCloseExit AfterPromptCloseAction = iota
	AfterPromptCloseRestart
)

type Highlighter

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

func (*Highlighter) Highlight

func (h *Highlighter) Highlight(d prompt.Document) ([]byte, error)

type InteractiveClient

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

InteractiveClient is a wrapper a Prompt to facilitate interactive query prompt

func (*InteractiveClient) ClosePrompt

func (c *InteractiveClient) ClosePrompt(afterClose AfterPromptCloseAction)

ClosePrompt cancels the running prompt, setting the action to take after close

func (*InteractiveClient) InteractivePrompt

func (c *InteractiveClient) InteractivePrompt(parentContext context.Context)

InteractivePrompt starts an interactive prompt and return

type QueryHistory

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

QueryHistory :: struct for working with history in the interactive mode

func (*QueryHistory) Get

func (q *QueryHistory) Get() []string

Get returns the full history

func (*QueryHistory) Peek

func (q *QueryHistory) Peek() *string

Peek returns the last element of the history stack. returns nil if there is no history

func (*QueryHistory) Persist

func (q *QueryHistory) Persist() error

Persist writes the history to the filesystem

func (*QueryHistory) Push

func (q *QueryHistory) Push(query string)

Push adds a string to the history queue trimming to maxHistorySize if necessary

type ResolvedQuery

type ResolvedQuery struct {
	ExecuteSQL  string
	IsMetaQuery bool
}

ResolvedQuery contains the execute SQL and flag indicating if the query is a meta query

Jump to

Keyboard shortcuts

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