commands

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 97 Imported by: 2

Documentation

Overview

Package commands contains the command functions executed based on the dolt subcommand specified on the command line.

The goal of the code within this package and sub packages is to be a thin client, handling user input and displaying formatted output to the user. The hope is that someone could take the library code, and implement the same functionality contained within the command line with very little work beyond providing a new user interface.

Index

Constants

View Source
const (
	SchemaOnlyDiff diffPart = 1 // 0b0001
	DataOnlyDiff   diffPart = 2 // 0b0010
	Summary        diffPart = 4 // 0b0100

	SchemaAndDataDiff = SchemaOnlyDiff | DataOnlyDiff

	TabularDiffOutput diffOutput = 1
	SQLDiffOutput     diffOutput = 2

	DataFlag    = "data"
	SchemaFlag  = "schema"
	SummaryFlag = "summary"

	SQLFlag    = "sql"
	CachedFlag = "cached"
)
View Source
const (
	SoftResetParam = "soft"
	HardResetParam = "hard"
)
View Source
const (
	QueryFlag  = "query"
	FormatFlag = "result-format"

	BatchFlag = "batch"
)
View Source
const (
	DryrunCleanParam = "dry-run"
)
View Source
const (
	SendMetricsCommand = "send-metrics"
)

SendMetricsCommand is the command used for sending metrics

Variables

View Source
var ErrInvalidPort = errors.New("invalid port")

Functions

func BuildVerrAndExit

func BuildVerrAndExit(errMsg string, cause error) int

BuildVerrAndExit is a shortcut for building a verbose error and calling HandleVerrAndExitCode with it

func CreateMarkdown

func CreateMarkdown(wr io.Writer, cmdDoc cli.CommandDocumentation) error

func GetResultFormat

func GetResultFormat(format string) (engine.PrintResultFormat, errhand.VerboseError)

func GetStagedWithVErr

func GetStagedWithVErr(dEnv *env.DoltEnv) (*doltdb.RootValue, errhand.VerboseError)

func GetWorkingWithVErr

func GetWorkingWithVErr(dEnv *env.DoltEnv) (*doltdb.RootValue, errhand.VerboseError)

func HandleDocTableVErrAndExitCode

func HandleDocTableVErrAndExitCode() int

func HandleVErrAndExitCode

func HandleVErrAndExitCode(verr errhand.VerboseError, usage cli.UsagePrinter) int

func HasTopLevelOrderByClause

func HasTopLevelOrderByClause(query string) bool

func MaybeGetCommitWithVErr

func MaybeGetCommitWithVErr(dEnv *env.DoltEnv, maybeCommit string) (*doltdb.Commit, errhand.VerboseError)

func MaybeMigrateEnv

func MaybeMigrateEnv(ctx context.Context, dEnv *env.DoltEnv) (*env.DoltEnv, error)

func NewSqlStatementScanner

func NewSqlStatementScanner(input io.Reader) *statementScanner

func PrintDiffsNotStaged

func PrintDiffsNotStaged(
	ctx context.Context,
	dEnv *env.DoltEnv,
	wr io.Writer,
	notStagedTbls []diff.TableDelta,
	notStagedDocs *diff.DocDiffs,
	printHelp bool,
	linesPrinted int,
	workingTblsInConflict, workingTblsWithViolations []string,
) int

func PrintStatus

func PrintStatus(ctx context.Context, dEnv *env.DoltEnv, stagedTbls, notStagedTbls []diff.TableDelta, workingTblsInConflict, workingTblsWithViolations []string, stagedDocs, notStagedDocs *diff.DocDiffs) error

TODO: working docs in conflict param not used here

func ResolveCommitWithVErr

func ResolveCommitWithVErr(dEnv *env.DoltEnv, cSpecStr string) (*doltdb.Commit, errhand.VerboseError)

func UpdateWorkingWithVErr

func UpdateWorkingWithVErr(dEnv *env.DoltEnv, updatedRoot *doltdb.RootValue) errhand.VerboseError

Types

type AddCmd

type AddCmd struct{}

func (AddCmd) ArgParser

func (cmd AddCmd) ArgParser() *argparser.ArgParser

func (AddCmd) CreateMarkdown

func (cmd AddCmd) CreateMarkdown(writer io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (AddCmd) Description

func (cmd AddCmd) Description() string

Description returns a description of the command

func (AddCmd) Exec

func (cmd AddCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (AddCmd) Name

func (cmd AddCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type BackupCmd

type BackupCmd struct{}

func (BackupCmd) ArgParser

func (cmd BackupCmd) ArgParser() *argparser.ArgParser

func (BackupCmd) CreateMarkdown

func (cmd BackupCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (BackupCmd) Description

func (cmd BackupCmd) Description() string

Description returns a description of the command

func (BackupCmd) EventType

func (cmd BackupCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (BackupCmd) Exec

func (cmd BackupCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (BackupCmd) GatedForNBF

func (cmd BackupCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (BackupCmd) Name

func (cmd BackupCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (BackupCmd) RequiresRepo

func (cmd BackupCmd) RequiresRepo() bool

type BlameCmd

type BlameCmd struct{}

func (BlameCmd) ArgParser

func (cmd BlameCmd) ArgParser() *argparser.ArgParser

func (BlameCmd) CreateMarkdown

func (cmd BlameCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (BlameCmd) Description

func (cmd BlameCmd) Description() string

Description returns a description of the command

func (BlameCmd) EventType

func (cmd BlameCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (BlameCmd) Exec

func (cmd BlameCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec implements the `dolt blame` command. Blame annotates each row in the given table with information from the revision which last modified the row, optionally starting from a given revision.

Blame is computed as follows:

First, a blame graph is initialized with one node for every row in the table at the given commit (defaulting to HEAD of the currently checked-out branch).

Starting from the given commit, walk backwards through the commit graph (currently by following each commit's first parent, though this may change in the future).

For each adjacent pair of commits `old` and `new`, check each remaining unblamed node to see if the row it represents changed between the commits. If so, mark it with `new` as the blame origin and continue to the next node without blame.

When all nodes have blame information, stop iterating through commits and print the blame graph. Exec executes the command

func (BlameCmd) GatedForNBF

func (cmd BlameCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (BlameCmd) Name

func (cmd BlameCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type BranchCmd

type BranchCmd struct{}

func (BranchCmd) ArgParser

func (cmd BranchCmd) ArgParser() *argparser.ArgParser

func (BranchCmd) CreateMarkdown

func (cmd BranchCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (BranchCmd) Description

func (cmd BranchCmd) Description() string

Description returns a description of the command

func (BranchCmd) EventType

func (cmd BranchCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (BranchCmd) Exec

func (cmd BranchCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (BranchCmd) Name

func (cmd BranchCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type CheckoutCmd

type CheckoutCmd struct{}

func (CheckoutCmd) ArgParser

func (cmd CheckoutCmd) ArgParser() *argparser.ArgParser

func (CheckoutCmd) CreateMarkdown

func (cmd CheckoutCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (CheckoutCmd) Description

func (cmd CheckoutCmd) Description() string

Description returns a description of the command

func (CheckoutCmd) EventType

func (cmd CheckoutCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (CheckoutCmd) Exec

func (cmd CheckoutCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (CheckoutCmd) Name

func (cmd CheckoutCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type CleanCmd

type CleanCmd struct{}

func (CleanCmd) ArgParser

func (cmd CleanCmd) ArgParser() *argparser.ArgParser

func (CleanCmd) CreateMarkdown

func (cmd CleanCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (CleanCmd) Description

func (cmd CleanCmd) Description() string

Description returns a description of the command

func (CleanCmd) Exec

func (cmd CleanCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (CleanCmd) Name

func (cmd CleanCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type CloneCmd

type CloneCmd struct{}

func (CloneCmd) ArgParser

func (cmd CloneCmd) ArgParser() *argparser.ArgParser

func (CloneCmd) CreateMarkdown

func (cmd CloneCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (CloneCmd) Description

func (cmd CloneCmd) Description() string

Description returns a description of the command

func (CloneCmd) EventType

func (cmd CloneCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (CloneCmd) Exec

func (cmd CloneCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (CloneCmd) Name

func (cmd CloneCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (CloneCmd) RequiresRepo

func (cmd CloneCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type CommitCmd

type CommitCmd struct{}

func (CommitCmd) ArgParser

func (cmd CommitCmd) ArgParser() *argparser.ArgParser

func (CommitCmd) CreateMarkdown

func (cmd CommitCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (CommitCmd) Description

func (cmd CommitCmd) Description() string

Description returns a description of the command

func (CommitCmd) Exec

func (cmd CommitCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (CommitCmd) Name

func (cmd CommitCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type ConfigCmd

type ConfigCmd struct{}

func (ConfigCmd) ArgParser

func (cmd ConfigCmd) ArgParser() *argparser.ArgParser

func (ConfigCmd) CreateMarkdown

func (cmd ConfigCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (ConfigCmd) Description

func (cmd ConfigCmd) Description() string

Description returns a description of the command

func (ConfigCmd) Exec

func (cmd ConfigCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec is used by the config command to allow users to view / edit their global and repository local configurations. Exec executes the command

func (ConfigCmd) Name

func (cmd ConfigCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (ConfigCmd) RequiresRepo

func (cmd ConfigCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type DiffCmd

type DiffCmd struct{}

func (DiffCmd) ArgParser

func (cmd DiffCmd) ArgParser() *argparser.ArgParser

func (DiffCmd) CreateMarkdown

func (cmd DiffCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (DiffCmd) Description

func (cmd DiffCmd) Description() string

Description returns a description of the command

func (DiffCmd) EventType

func (cmd DiffCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (DiffCmd) Exec

func (cmd DiffCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (DiffCmd) Name

func (cmd DiffCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type DiffSink

type DiffSink interface {
	GetSchema() schema.Schema
	ProcRowWithProps(r row.Row, props pipeline.ReadableMap) error
	Close() error
}

type DumpCmd

type DumpCmd struct{}

func (DumpCmd) ArgParser

func (cmd DumpCmd) ArgParser() *argparser.ArgParser

func (DumpCmd) CreateMarkdown

func (cmd DumpCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the help text for the command at the given path

func (DumpCmd) Description

func (cmd DumpCmd) Description() string

Description returns a description of the command

func (DumpCmd) EventType

func (cmd DumpCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (DumpCmd) Exec

func (cmd DumpCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (DumpCmd) Name

func (cmd DumpCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type DumpDocsCmd

type DumpDocsCmd struct {
	DoltCommand cli.SubCommandHandler
}

func (*DumpDocsCmd) ArgParser

func (cmd *DumpDocsCmd) ArgParser() *argparser.ArgParser

func (*DumpDocsCmd) CreateMarkdown

func (cmd *DumpDocsCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (*DumpDocsCmd) Description

func (cmd *DumpDocsCmd) Description() string

Description returns a description of the command

func (*DumpDocsCmd) Exec

func (cmd *DumpDocsCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (*DumpDocsCmd) GatedForNBF

func (cmd *DumpDocsCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (*DumpDocsCmd) Hidden

func (cmd *DumpDocsCmd) Hidden() bool

Hidden should return true if this command should be hidden from the help text

func (*DumpDocsCmd) Name

func (cmd *DumpDocsCmd) Name() string

Name returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (*DumpDocsCmd) RequiresRepo

func (cmd *DumpDocsCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type FetchCmd

type FetchCmd struct{}

func (FetchCmd) ArgParser

func (cmd FetchCmd) ArgParser() *argparser.ArgParser

func (FetchCmd) CreateMarkdown

func (cmd FetchCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (FetchCmd) Description

func (cmd FetchCmd) Description() string

Description returns a description of the command

func (FetchCmd) EventType

func (cmd FetchCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (FetchCmd) Exec

func (cmd FetchCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (FetchCmd) GatedForNBF

func (cmd FetchCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (FetchCmd) Name

func (cmd FetchCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type FilterBranchCmd

type FilterBranchCmd struct{}

func (FilterBranchCmd) ArgParser

func (cmd FilterBranchCmd) ArgParser() *argparser.ArgParser

func (FilterBranchCmd) CreateMarkdown

func (cmd FilterBranchCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (FilterBranchCmd) Description

func (cmd FilterBranchCmd) Description() string

Description returns a description of the command

func (FilterBranchCmd) EventType

func (cmd FilterBranchCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (FilterBranchCmd) Exec

func (cmd FilterBranchCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (FilterBranchCmd) GatedForNBF

func (cmd FilterBranchCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (FilterBranchCmd) Name

func (cmd FilterBranchCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type FilterFn

type FilterFn = func(r row.Row) (matchesFilter bool)

func ParseWhere

func ParseWhere(sch schema.Schema, whereClause string) (FilterFn, error)

type GarbageCollectionCmd

type GarbageCollectionCmd struct{}

func (GarbageCollectionCmd) ArgParser

func (cmd GarbageCollectionCmd) ArgParser() *argparser.ArgParser

func (GarbageCollectionCmd) CreateMarkdown

func (cmd GarbageCollectionCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (GarbageCollectionCmd) Description

func (cmd GarbageCollectionCmd) Description() string

Description returns a description of the command

func (GarbageCollectionCmd) EventType

EventType returns the type of the event to log

func (GarbageCollectionCmd) Exec

func (cmd GarbageCollectionCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Version displays the version of the running dolt client Exec executes the command

func (GarbageCollectionCmd) GatedForNBF

func (cmd GarbageCollectionCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (GarbageCollectionCmd) Hidden

func (cmd GarbageCollectionCmd) Hidden() bool

Hidden should return true if this command should be hidden from the help text

func (GarbageCollectionCmd) Name

func (cmd GarbageCollectionCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (GarbageCollectionCmd) RequiresRepo

func (cmd GarbageCollectionCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type GenZshCompCmd

type GenZshCompCmd struct {
	DoltCommand cli.SubCommandHandler
}

func (GenZshCompCmd) ArgParser

func (z GenZshCompCmd) ArgParser() *argparser.ArgParser

func (GenZshCompCmd) CreateMarkdown

func (z GenZshCompCmd) CreateMarkdown(writer io.Writer, commandStr string) error

func (GenZshCompCmd) Description

func (z GenZshCompCmd) Description() string

func (GenZshCompCmd) Exec

func (z GenZshCompCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

func (GenZshCompCmd) Hidden

func (z GenZshCompCmd) Hidden() bool

Hidden should return true if this command should be hidden from the help text

func (GenZshCompCmd) Name

func (z GenZshCompCmd) Name() string

func (GenZshCompCmd) RequiresRepo

func (z GenZshCompCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type InitCmd

type InitCmd struct{}

func (InitCmd) ArgParser

func (cmd InitCmd) ArgParser() *argparser.ArgParser

func (InitCmd) CreateMarkdown

func (cmd InitCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (InitCmd) Description

func (cmd InitCmd) Description() string

Description returns a description of the command

func (InitCmd) Exec

func (cmd InitCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (InitCmd) Name

func (cmd InitCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (InitCmd) RequiresRepo

func (cmd InitCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type InspectCmd

type InspectCmd struct {
}

func (InspectCmd) ArgParser

func (cmd InspectCmd) ArgParser() *argparser.ArgParser

func (InspectCmd) CreateMarkdown

func (cmd InspectCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (InspectCmd) Description

func (cmd InspectCmd) Description() string

Description returns a description of the command

func (InspectCmd) Exec

func (cmd InspectCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (InspectCmd) GatedForNBF

func (cmd InspectCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (InspectCmd) Hidden

func (cmd InspectCmd) Hidden() bool

Hidden should return true if this command should be hidden from the help text

func (InspectCmd) Name

func (cmd InspectCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (InspectCmd) RequiresRepo

func (cmd InspectCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type LogCmd

type LogCmd struct{}

func (LogCmd) ArgParser

func (cmd LogCmd) ArgParser() *argparser.ArgParser

func (LogCmd) CreateMarkdown

func (cmd LogCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (LogCmd) Description

func (cmd LogCmd) Description() string

Description returns a description of the command

func (LogCmd) EventType

func (cmd LogCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (LogCmd) Exec

func (cmd LogCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (LogCmd) Name

func (cmd LogCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type LoginCmd

type LoginCmd struct{}

func (LoginCmd) ArgParser

func (cmd LoginCmd) ArgParser() *argparser.ArgParser

func (LoginCmd) CreateMarkdown

func (cmd LoginCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (LoginCmd) Description

func (cmd LoginCmd) Description() string

Description returns a description of the command

func (LoginCmd) EventType

func (cmd LoginCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (LoginCmd) Exec

func (cmd LoginCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (LoginCmd) InstallsSignalHandlers

func (cmd LoginCmd) InstallsSignalHandlers() bool

The LoginCmd doesn't handle its own signals, but should stop cancel global context when receiving SIGINT signal

func (LoginCmd) Name

func (cmd LoginCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (LoginCmd) RequiresRepo

func (cmd LoginCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type LsCmd

type LsCmd struct{}

func (LsCmd) ArgParser

func (cmd LsCmd) ArgParser() *argparser.ArgParser

func (LsCmd) CreateMarkdown

func (cmd LsCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (LsCmd) Description

func (cmd LsCmd) Description() string

Description returns a description of the command

func (LsCmd) EventType

func (cmd LsCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (LsCmd) Exec

func (cmd LsCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (LsCmd) Name

func (cmd LsCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type MergeBaseCmd

type MergeBaseCmd struct{}

func (MergeBaseCmd) ArgParser

func (cmd MergeBaseCmd) ArgParser() *argparser.ArgParser

func (MergeBaseCmd) CreateMarkdown

func (cmd MergeBaseCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (MergeBaseCmd) Description

func (cmd MergeBaseCmd) Description() string

Description returns a description of the command

func (MergeBaseCmd) EventType

func (cmd MergeBaseCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (MergeBaseCmd) Exec

func (cmd MergeBaseCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (MergeBaseCmd) Name

func (cmd MergeBaseCmd) Name() string

Name returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type MergeCmd

type MergeCmd struct{}

func (MergeCmd) ArgParser

func (cmd MergeCmd) ArgParser() *argparser.ArgParser

func (MergeCmd) CreateMarkdown

func (cmd MergeCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (MergeCmd) Description

func (cmd MergeCmd) Description() string

Description returns a description of the command

func (MergeCmd) EventType

func (cmd MergeCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (MergeCmd) Exec

func (cmd MergeCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (MergeCmd) Name

func (cmd MergeCmd) Name() string

Name returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type MigrateCmd

type MigrateCmd struct{}

func (MigrateCmd) ArgParser

func (cmd MigrateCmd) ArgParser() *argparser.ArgParser

func (MigrateCmd) CreateMarkdown

func (cmd MigrateCmd) CreateMarkdown(_ io.Writer, _ string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (MigrateCmd) Description

func (cmd MigrateCmd) Description() string

Description returns a description of the command

func (MigrateCmd) EventType

func (cmd MigrateCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (MigrateCmd) Exec

func (cmd MigrateCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (MigrateCmd) Name

func (cmd MigrateCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type PullCmd

type PullCmd struct{}

func (PullCmd) ArgParser

func (cmd PullCmd) ArgParser() *argparser.ArgParser

func (PullCmd) CreateMarkdown

func (cmd PullCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (PullCmd) Description

func (cmd PullCmd) Description() string

Description returns a description of the command

func (PullCmd) EventType

func (cmd PullCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (PullCmd) Exec

func (cmd PullCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (PullCmd) GatedForNBF

func (cmd PullCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (PullCmd) Name

func (cmd PullCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type PushCmd

type PushCmd struct{}

func (PushCmd) ArgParser

func (cmd PushCmd) ArgParser() *argparser.ArgParser

func (PushCmd) CreateMarkdown

func (cmd PushCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (PushCmd) Description

func (cmd PushCmd) Description() string

Description returns a description of the command

func (PushCmd) EventType

func (cmd PushCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (PushCmd) Exec

func (cmd PushCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (PushCmd) GatedForNBF

func (cmd PushCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (PushCmd) Name

func (cmd PushCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type ReadTablesCmd

type ReadTablesCmd struct{}

ReadTablesCmd is the implementation of the shallow-clone command

func (ReadTablesCmd) ArgParser

func (cmd ReadTablesCmd) ArgParser() *argparser.ArgParser

func (ReadTablesCmd) CreateMarkdown

func (cmd ReadTablesCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (ReadTablesCmd) Description

func (cmd ReadTablesCmd) Description() string

Description returns a description of the command

func (ReadTablesCmd) Exec

func (cmd ReadTablesCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (ReadTablesCmd) GatedForNBF

func (cmd ReadTablesCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (ReadTablesCmd) Name

func (cmd ReadTablesCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (ReadTablesCmd) RequiresRepo

func (cmd ReadTablesCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type RemoteCmd

type RemoteCmd struct{}

func (RemoteCmd) ArgParser

func (cmd RemoteCmd) ArgParser() *argparser.ArgParser

func (RemoteCmd) CreateMarkdown

func (cmd RemoteCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (RemoteCmd) Description

func (cmd RemoteCmd) Description() string

Description returns a description of the command

func (RemoteCmd) EventType

func (cmd RemoteCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (RemoteCmd) Exec

func (cmd RemoteCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (RemoteCmd) GatedForNBF

func (cmd RemoteCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (RemoteCmd) Name

func (cmd RemoteCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type ResetCmd

type ResetCmd struct{}

func (ResetCmd) ArgParser

func (cmd ResetCmd) ArgParser() *argparser.ArgParser

func (ResetCmd) CreateMarkdown

func (cmd ResetCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (ResetCmd) Description

func (cmd ResetCmd) Description() string

Description returns a description of the command

func (ResetCmd) Exec

func (cmd ResetCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (ResetCmd) Name

func (cmd ResetCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type RevertCmd

type RevertCmd struct{}

func (RevertCmd) ArgParser

func (cmd RevertCmd) ArgParser() *argparser.ArgParser

func (RevertCmd) CreateMarkdown

func (cmd RevertCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown implements the interface cli.Command.

func (RevertCmd) Description

func (cmd RevertCmd) Description() string

Description implements the interface cli.Command.

func (RevertCmd) Exec

func (cmd RevertCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec implements the interface cli.Command.

func (RevertCmd) GatedForNBF

func (cmd RevertCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (RevertCmd) Name

func (cmd RevertCmd) Name() string

Name implements the interface cli.Command.

type RootsCmd

type RootsCmd struct {
}

func (RootsCmd) ArgParser

func (cmd RootsCmd) ArgParser() *argparser.ArgParser

func (RootsCmd) CreateMarkdown

func (cmd RootsCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (RootsCmd) Description

func (cmd RootsCmd) Description() string

Description returns a description of the command

func (RootsCmd) Exec

func (cmd RootsCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (RootsCmd) GatedForNBF

func (cmd RootsCmd) GatedForNBF(nbf *types.NomsBinFormat) bool

func (RootsCmd) Hidden

func (cmd RootsCmd) Hidden() bool

Hidden should return true if this command should be hidden from the help text

func (RootsCmd) Name

func (cmd RootsCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (RootsCmd) RequiresRepo

func (cmd RootsCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type SelectTransform

type SelectTransform struct {
	Pipeline *pipeline.Pipeline
	// contains filtered or unexported fields
}

func NewSelTrans

func NewSelTrans(filter FilterFn, limit int) *SelectTransform

func (*SelectTransform) LimitAndFilter

func (st *SelectTransform) LimitAndFilter(inRow row.Row, props pipeline.ReadableMap) ([]*pipeline.TransformedRowResult, string)

type SendMetricsCmd

type SendMetricsCmd struct{}

func (SendMetricsCmd) ArgParser

func (cmd SendMetricsCmd) ArgParser() *argparser.ArgParser

func (SendMetricsCmd) CreateMarkdown

func (cmd SendMetricsCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (SendMetricsCmd) Description

func (cmd SendMetricsCmd) Description() string

Description returns a description of the command

func (SendMetricsCmd) Exec

func (cmd SendMetricsCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec is the implementation of the command that flushes the events to the grpc service Exec executes the command

func (SendMetricsCmd) Hidden

func (cmd SendMetricsCmd) Hidden() bool

Hidden should return true if this command should be hidden from the help text

func (SendMetricsCmd) Name

func (cmd SendMetricsCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (SendMetricsCmd) RequiresRepo

func (cmd SendMetricsCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

type SqlCmd

type SqlCmd struct {
	VersionStr string
}

func (SqlCmd) ArgParser

func (cmd SqlCmd) ArgParser() *argparser.ArgParser

func (SqlCmd) CreateMarkdown

func (cmd SqlCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (SqlCmd) Description

func (cmd SqlCmd) Description() string

Description returns a description of the command

func (SqlCmd) EventType

func (cmd SqlCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (SqlCmd) Exec

func (cmd SqlCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command Unlike other commands, sql doesn't set a new working root directly, as the SQL layer updates the working set as necessary when committing work.

func (SqlCmd) InstallsSignalHandlers

func (cmd SqlCmd) InstallsSignalHandlers() bool

The SQL shell installs its own signal handlers so that you can cancel a running query without ending the entire process

func (SqlCmd) Name

func (cmd SqlCmd) Name() string

Name returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (SqlCmd) RequiresRepo

func (cmd SqlCmd) RequiresRepo() bool

RequiresRepo indicates that this command does not have to be run from within a dolt data repository directory. In this case it is because this command supports the multiDBDirFlag which can pass in a directory. In the event that that parameter is not provided there is additional error handling within this command to make sure that this was in fact run from within a dolt data repository directory.

type StatusCmd

type StatusCmd struct{}

func (StatusCmd) ArgParser

func (cmd StatusCmd) ArgParser() *argparser.ArgParser

func (StatusCmd) CreateMarkdown

func (cmd StatusCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (StatusCmd) Description

func (cmd StatusCmd) Description() string

Description returns a description of the command

func (StatusCmd) Exec

func (cmd StatusCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (StatusCmd) Name

func (cmd StatusCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type TableFileIter

type TableFileIter struct {
	// contains filtered or unexported fields
}

func NewTableFileIter

func NewTableFileIter(dirs []string, fs filesys.Filesys) (*TableFileIter, error)

type TagCmd

type TagCmd struct{}

func (TagCmd) ArgParser

func (cmd TagCmd) ArgParser() *argparser.ArgParser

func (TagCmd) CreateMarkdown

func (cmd TagCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (TagCmd) Description

func (cmd TagCmd) Description() string

Description returns a description of the command

func (TagCmd) EventType

func (cmd TagCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (TagCmd) Exec

func (cmd TagCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Exec executes the command

func (TagCmd) Name

func (cmd TagCmd) Name() string

Name returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

type TextSpinner

type TextSpinner struct {
	// contains filtered or unexported fields
}

type VersionCmd

type VersionCmd struct {
	VersionStr string
}

func (VersionCmd) ArgParser

func (cmd VersionCmd) ArgParser() *argparser.ArgParser

func (VersionCmd) CreateMarkdown

func (cmd VersionCmd) CreateMarkdown(wr io.Writer, commandStr string) error

CreateMarkdown creates a markdown file containing the helptext for the command at the given path

func (VersionCmd) Description

func (cmd VersionCmd) Description() string

Description returns a description of the command

func (VersionCmd) Exec

func (cmd VersionCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv) int

Version displays the version of the running dolt client Exec executes the command

func (VersionCmd) Name

func (cmd VersionCmd) Name() string

Name is returns the name of the Dolt cli command. This is what is used on the command line to invoke the command

func (VersionCmd) RequiresRepo

func (cmd VersionCmd) RequiresRepo() bool

RequiresRepo should return false if this interface is implemented, and the command does not have the requirement that it be run from within a data repository directory

Directories

Path Synopsis
Package tblcmds contains table subcommand command functions for making changes to tables.
Package tblcmds contains table subcommand command functions for making changes to tables.

Jump to

Keyboard shortcuts

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