cli

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MultilineCLIPrefix = ":-] "

MultilineCLIPrefix shows that multiline input is activated

Variables

View Source
var ErrArgumentNotProvided = errors.New("argument to meta-command doesnt provided")

ErrArgumentNotProvided error.

View Source
var ErrInvalidMetaCommand = errors.New("incorrect meta-command")

ErrInvalidMetaCommand error.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	Session   *chdb.Session
	Multiline bool
	// contains filtered or unexported fields
}

CLI object of cli :)

func New

func New(sess *chdb.Session, history *history.History, multiline bool) *CLI

New - returns CLI object

func (*CLI) Executor

func (c *CLI) Executor(s string)

Executor - exec query and write it to history + checking for one of quit commands.

func (*CLI) GetCurrentDB

func (c *CLI) GetCurrentDB(ctx context.Context) string

GetCurrentDB from chDB

func (*CLI) GetLivePrefixState

func (c *CLI) GetLivePrefixState() (string, bool)

GetLivePrefixState - returns prefix and multiline input current state (true/false)

func (*CLI) MetaToSQL

func (c *CLI) MetaToSQL(metaCommand string) (string, error)

MetaToSQL convert meta-command to SQL expression

func (*CLI) MultilineControl

func (c *CLI) MultilineControl(buffer *prompt.Buffer)

MultilineControl is a multiline toggle.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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