Documentation ¶
Index ¶
- Variables
- type Handler
- func (h *Handler) Buf() *stmt.Stmt
- func (h *Handler) Close() error
- func (h *Handler) DB() *sql.DB
- 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) IO() rline.IO
- func (h *Handler) Include(path string, relative bool) error
- func (h *Handler) Last() string
- func (h *Handler) Open(params ...string) error
- func (h *Handler) OutputRows(w io.Writer, q *sql.Rows) error
- func (h *Handler) Password(dsn string) (string, error)
- func (h *Handler) Prompt() string
- func (h *Handler) Query(w io.Writer, _, sqlstr string) error
- func (h *Handler) Reset(r []rune)
- func (h *Handler) Run() error
- func (h *Handler) URL() *dburl.URL
- func (h *Handler) User() *user.User
- func (h *Handler) Version() error
- type OnOff
Constants ¶
This section is empty.
Variables ¶
var ( // 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") // ErrMissingDSN is the missing dsn error. ErrMissingDSN = errors.New("missing dsn") )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a input process handler.
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) OutputRows ¶ added in v0.3.0
OutputRows outputs the supplied SQL rows to the supplied writer.
func (*Handler) Password ¶ added in v0.4.0
Password collects a password from input, and returning a modified DSN including the collected password.
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.