Documentation ¶
Index ¶
- type Handler
- func (h *Handler) Begin() error
- func (h *Handler) Buf() *stmt.Stmt
- func (h *Handler) ChangePassword(user string) (string, error)
- func (h *Handler) Close() error
- func (h *Handler) Commit() error
- func (h *Handler) DB() drivers.DB
- func (h *Handler) Execute(w io.Writer, res metacmd.Result, prefix, qstr string, forceTrans bool) error
- func (h *Handler) Highlight(w io.Writer, buf string) error
- func (h *Handler) IO() rline.IO
- func (h *Handler) Include(path string, relative bool) error
- func (h *Handler) Last() string
- func (h *Handler) LastRaw() string
- func (h *Handler) Open(params ...string) error
- func (h *Handler) Password(dsn string) (string, error)
- func (h *Handler) Prompt() string
- func (h *Handler) ReadVar(typ, prompt string) (string, error)
- func (h *Handler) Reset(r []rune)
- func (h *Handler) Rollback() error
- func (h *Handler) Run() error
- func (h *Handler) SetSingleLineMode(singleLineMode bool)
- func (h *Handler) URL() *dburl.URL
- func (h *Handler) User() *user.User
- func (h *Handler) Version() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a input process handler.
func (*Handler) ChangePassword ¶ added in v0.5.0
ChangePassword changes a password for the user.
func (*Handler) Execute ¶
func (h *Handler) Execute(w io.Writer, res metacmd.Result, prefix, qstr string, forceTrans bool) error
Execute executes a query against the connected database.
func (*Handler) Highlight ¶ added in v0.6.0
Highlight highlights using the current environment settings.
func (*Handler) LastRaw ¶ added in v0.7.0
LastRaw returns the last raw (non-interpolated) executed statement.
func (*Handler) Open ¶
Open handles opening a specified database URL, passing either a single string in the form of a URL, or more than one string, in which case the first string is treated as a driver name, and the remaining strings are joined (with a space) and passed as a DSN to sql.Open.
If there is only one parameter, and it is not a well formatted URL, but appears to be a file on disk, then an attempt will be made to open it with an appropriate driver (mysql, postgres, sqlite3) depending on the type (unix domain socket, directory, or regular file, respectively).
func (*Handler) Password ¶ added in v0.4.0
Password collects a password from input, and returns a modified DSN including the collected password.
func (*Handler) ReadVar ¶ added in v0.5.0
ReadVar reads a variable from the interactive prompt, saving it to environment variables.
func (*Handler) SetSingleLineMode ¶ added in v0.7.1
SetSingleLineMode sets the single line mode toggle.