text

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")

	// ErrNoPreviousTransactionExists is the no previous transaction exists error.
	ErrNoPreviousTransactionExists = errors.New("no previous transaction exists")

	// ErrPreviousTransactionExists is the previous transaction exists error.
	ErrPreviousTransactionExists = errors.New("previous transaction exists")

	// ErrPasswordAttemptsExhausted is the exhausted password attempts error.
	ErrPasswordAttemptsExhausted = errors.New("password attempts exhausted")

	// ErrSingleTransactionCannotBeUsedWithInteractiveMode is the single transaction cannot be used with interactive mode error.
	ErrSingleTransactionCannotBeUsedWithInteractiveMode = errors.New("--single-transaction cannot be used with interactive mode")

	// ErrNoEditorDefined is the no editor defined error.
	ErrNoEditorDefined = errors.New("no editor defined")

	// ErrUnknownCommand is the unknown command error.
	ErrUnknownCommand = errors.New("unknown command")

	// ErrMissingRequiredArgument is the missing required argument error.
	ErrMissingRequiredArgument = errors.New("missing required argument")

	// ErrDriverNotAvailable is the driver not available error.
	ErrDriverNotAvailable = errors.New("driver not available")

	// ErrPasswordNotSupportedByDriver is the password not supported by driver error.
	ErrPasswordNotSupportedByDriver = errors.New(`\password not supported by driver`)

	// ErrUnterminatedString is the unterminated string error.
	ErrUnterminatedString = errors.New("unterminated string")

	// ErrNoShellAvailable is the no SHELL available error.
	ErrNoShellAvailable = errors.New("no SHELL available")

	// ErrNotInteractive is the not interactive error.
	ErrNotInteractive = errors.New("not interactive")

	// ErrInvalidType is the invalid type error.
	ErrInvalidType = errors.New("invalid -TYPE: TYPE must be password, string, int, uint, float, or bool")

	// ErrInvalidIdentifier is the invalid identifier error.
	ErrInvalidIdentifier = errors.New("invalid identifier")

	// ErrInvalidValue is the invalid value error.
	ErrInvalidValue = errors.New("invalid value")

	// ErrTooManyRows is the too many rows error.
	ErrTooManyRows = errors.New("too many rows")

	// ErrInvalidFormatType is the invalid format type error.
	ErrInvalidFormatType = errors.New(`\pset: allowed formats are unaligned, aligned, wrapped, html, asciidoc, latex, latex-longtable, troff-ms, json, csv`)

	// ErrInvalidFormatExpandedType is the invalid format expanded error.
	ErrInvalidFormatExpandedType = errors.New(`\pset: allowed expanded values are on, off, auto`)

	// ErrInvalidFormatLineStyle is the invalid format line style error.
	ErrInvalidFormatLineStyle = errors.New(`\pset: allowed line styles are ascii, old-ascii, unicode`)

	// ErrInvalidFormatBorderLineStyle is the invalid format border line style error.
	ErrInvalidFormatBorderLineStyle = errors.New(`\pset: allowed Unicode border line styles are single, double`)
)
View Source
var (
	CommandName = `usql`

	CommandVersion = `0.0.0-dev`


	NotConnected = `(not connected)`

	HelpPrefix = `help`

	WelcomeDesc = `Type "` + HelpPrefix + `" for help.`

	QueryBufferEmpty = `Query buffer is empty.`

	QueryBufferReset = `Query buffer reset (cleared).`

	InvalidCommand = `Invalid command \%s. Try \? for help.`

	ExtraArgumentIgnored = `\%s: extra argument %q ignored`

	MissingRequiredArg = `\%s: missing required argument`

	Copyright = CommandName + ", " + Banner + ".\n\n" + License

	RowCount = `(%d rows)`

	AvailableDrivers = `Available Drivers:`

	ConnInfo = `Connected with driver %s (%s)`

	BadPassFile = `could not open %q, not a file`

	BadPassFileMode = `password file %q has group or world access`

	BadPassFileLine = `line %d of password file incorrectly formatted`

	BadPassFileFieldEmpty = `line %d field %d of password file cannot be blank`

	BadPassFileUsername = `username in line %d of password file cannot contain *`

	EnterPassword = `Enter password: `

	EnterPreviousPassword = `Enter previous password: `

	PasswordsDoNotMatch = `Passwords do not match, trying again ...`

	NewPassword = `Enter new password: `

	ConfirmPassword = `Confirm password: `

	PasswordChangeFailed = `\password for %q failed: %v`

	CouldNotSetVariable = `could not set variable %q`

	HelpDesc string

	HelpBanner = `You are using ` + CommandName + ", " + Banner + `.`

	HelpCommandPrefix = `Type:  `

	HelpCommands = [][]string{
		{`copyright`, `for distribution terms`},

		{`?`, `for help with ` + CommandName + ` commands`},
		{`g`, `or terminate with semicolon to execute query`},
		{`q`, `to quit`},
	}

	UnknownFormatFieldName = `unknown option: %s`

	FormatFieldInvalidValue = `unrecognized value %q for %q: %s expected`

	FormatFieldNameSetMap = map[string]string{
		`border`:                   `Border style is %d.`,
		`columns`:                  `Target width is %d.`,
		`expanded`:                 `Expanded display is %s.`,
		`expanded_auto`:            `Expanded display is used automatically.`,
		`fieldsep`:                 `Field separator is %q.`,
		`fieldsep_zero`:            `Field separator is zero byte.`,
		`footer`:                   `Default footer is %s.`,
		`format`:                   `Output format is %s.`,
		`linestyle`:                `Line style is %s.`,
		`null`:                     `Null display is %q.`,
		`numericlocale`:            `Locale-adjusted numeric output is %s.`,
		`pager`:                    `Pager usage is %s.`,
		`pager_min_lines`:          `Pager won't be used for less than %d line(s).`,
		`recordsep`:                `Field separator is %q.`,
		`recordsep_zero`:           `Record separator is zero byte.`,
		`tableattr`:                `Table attributes are %q.`,
		`title`:                    `Title is %q.`,
		`tuples_only`:              `Tuples only is %s.`,
		`unicode_border_linestyle`: `Unicode border line style is %q.`,
		`unicode_column_linestyle`: `Unicode column line style is %q.`,
		`unicode_header_linestyle`: `Unicode header line style is %q.`,
	}

	FormatFieldNameUnsetMap = map[string]string{
		`tableattr`: `Table attributes unset.`,
		`title`:     `Title is unset.`,
	}
)

Various usql text bits.

View Source
var Command = func() string {
	return spaceRE.ReplaceAllString(CommandName, "")
}

Command returns the command name without spaces.

View Source
var CommandLower = func() string {
	return strings.ToLower(Command())
}

CommandLower returns the lower case command name without spaces.

View Source
var CommandUpper = func() string {
	return strings.ToUpper(Command())
}

CommandUpper returns the upper case command name without spaces.

View Source
var License = `` /* 1083-byte string literal not displayed */

License contains the license text for usql.

View Source
var UsageTemplate = func() string {
	n := CommandLower()

	return n + `, ` + Banner + `

Usage:
  ` + n + ` [OPTIONS]... [DSN]

Arguments:
  DSN                            database url

{{if .Context.Flags}}\
Options:
{{.Context.Flags|FlagsToTwoColumns|FormatTwoColumns}}{{end}}`
}

UsageTemplate returns the usage template.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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