Documentation
¶
Index ¶
- Variables
- func SetAvailableDrivers(m map[string]string)
- type Error
- type Handler
- func (h *Handler) Close() error
- func (h *Handler) DisplayHelp(w io.Writer)
- func (h *Handler) Exec(w io.Writer, typ, sqlstr string) error
- func (h *Handler) Execute(w io.Writer, prefix, sqlstr string) error
- func (h *Handler) ForceInteractive(interactive bool)
- func (h *Handler) HistoryFile() string
- func (h *Handler) IncludeFile(path string, relative bool) error
- func (h *Handler) LaunchEditor(path, line, s string) ([]rune, error)
- func (h *Handler) Open(params ...string) error
- func (h *Handler) OutputRows(w io.Writer, q *sql.Rows) error
- func (h *Handler) Process(stdin io.Reader, stdout, stderr io.Writer) error
- func (h *Handler) ProcessPrefix(prefix, sqlstr string) (string, bool)
- func (h *Handler) Query(w io.Writer, _, sqlstr string) error
- func (h *Handler) RunCommands(cmds []string) error
- func (h *Handler) RunReadline(in, out string) error
- func (h *Handler) SetPrompt(l *readline.Instance, state string)
- func (h *Handler) WrapError(err error) error
- type OnOff
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDriverNotAvailable is the driver not available error. ErrDriverNotAvailable = errors.New("driver not available") // ErrNotConnected is the not connected error. ErrNotConnected = errors.New("not connected") // ErrNoSuchFileOrDirectory is the no such file or directory error. ErrNoSuchFileOrDirectory = errors.New("no such file or directory") // ErrCannotIncludeDirectories is the cannot include directories error. ErrCannotIncludeDirectories = errors.New("cannot include directories") // ErrNoEditorDefined is the no editor defined error. ErrNoEditorDefined = errors.New("no editor defined") )
Functions ¶
func SetAvailableDrivers ¶
SetAvailableDrivers sets the known available drivers.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a input process handler.
func (*Handler) DisplayHelp ¶
DisplayHelp displays the help message.
func (*Handler) ForceInteractive ¶
ForceInteractive forces the interactive mode.
func (*Handler) HistoryFile ¶
HistoryFile returns the history file name for the handler.
func (*Handler) IncludeFile ¶
IncludeFile includes the specified path.
func (*Handler) LaunchEditor ¶
LaunchEditor launches an editor using the current query buffer.
func (*Handler) OutputRows ¶ added in v0.3.0
OutputRows outputs the supplied SQL rows to the supplied writer.
func (*Handler) Process ¶
Process reads line commands from stdin, writing output to stdout and stderr.
func (*Handler) ProcessPrefix ¶ added in v0.3.0
ProcessPrefix processes a prefix.
func (*Handler) RunCommands ¶
RunCommands processes command line arguments.
func (*Handler) RunReadline ¶
RunReadline processes input.
type OnOff ¶ added in v0.3.0
OnOff is a type that wraps a bool, for use in parsing/displaying command parameters.
func (OnOff) MarshalText ¶ added in v0.3.0
MarshalText satisfies the TextMarhsaler interface.
func (*OnOff) UnmarshalText ¶ added in v0.3.0
UnmarshalText satisfies the TextUnmarshaler interface.