console

package
v0.0.0-...-78193eb Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile() string

ConfigFile returns the config file path

func Execute

func Execute(ctx context.Context, conn *sql.DB, query string) ([]map[string]interface{}, []string, error)

Execute a query and return array of mapped results

func JoinWords

func JoinWords(words []string, deli string) string

JoinWords similar to strings.Join but surrounding reserved words in double quotes

func Register

func Register(p Plugin)

Register registers plugin

func Run

func Run() error

Run runs the sql console

func SetConfigFile

func SetConfigFile(p string) error

SetConfigFile sets the path for the config file, must be .json

func SetCredentials

func SetCredentials(username, password, url string)

SetCredentials prepopulates creditials but does not save them to dist

func SetHistoryFile

func SetHistoryFile(p string) error

SetHistoryFile sets the history file to be used, call this before calling Run

func Word

func Word(str string) string

Word returns a dremio-friendly word

Types

type Plugin

type Plugin struct {
	Query       string
	Usage       string
	Description string
	Callback    func(ctx context.Context, conn *sql.DB, input string) error
	AfterQuery  pluginAfterFunc
}

Plugin ...

Jump to

Keyboard shortcuts

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