schcmds

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: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = cli.NewSubCommandHandler("schema", "Commands for showing and importing table schemas.", []cli.Command{
	ExportCmd{},
	ImportCmd{},
	ShowCmd{},
	TagsCmd{},
})
View Source
var MappingFileHelp = "A mapping file is json in the format:" + `

	{
		"source_field_name":"dest_field_name"
		...
	}

where source_field_name is the name of a field in the file being imported and dest_field_name is the name of a field in the table being imported to.
`

Functions

func CombineColCollections

func CombineColCollections(ctx context.Context, root *doltdb.RootValue, inferredCols *schema.ColCollection, impOpts *importOptions) (schema.Schema, errhand.VerboseError)

func ValidateTableNameForCreate

func ValidateTableNameForCreate(tableName string) errhand.VerboseError

ValidateTableNameForCreate validates the given table name for creation as a user table, returning an error if the table name is not valid.

Types

type ExportCmd

type ExportCmd struct{}

func (ExportCmd) ArgParser

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

func (ExportCmd) CreateMarkdown

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

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

func (ExportCmd) Description

func (cmd ExportCmd) Description() string

Description returns a description of the command

func (ExportCmd) EventType

func (cmd ExportCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (ExportCmd) Exec

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

Exec executes the command

func (ExportCmd) Name

func (cmd ExportCmd) 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 ImportCmd

type ImportCmd struct{}

func (ImportCmd) ArgParser

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

func (ImportCmd) CreateMarkdown

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

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

func (ImportCmd) Description

func (cmd ImportCmd) Description() string

Description returns a description of the command

func (ImportCmd) EventType

func (cmd ImportCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (ImportCmd) Exec

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

Exec implements the import schema command that will take a file and infer it's schema, and then create a table matching that schema. Exec executes the command

func (ImportCmd) Name

func (cmd ImportCmd) 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 SchImportOp

type SchImportOp int
const (
	CreateOp SchImportOp = iota
	UpdateOp
	ReplaceOp
)

type ShowCmd

type ShowCmd struct{}

func (ShowCmd) ArgParser

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

func (ShowCmd) CreateMarkdown

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

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

func (ShowCmd) Description

func (cmd ShowCmd) Description() string

Description returns a description of the command

func (ShowCmd) EventType

func (cmd ShowCmd) EventType() eventsapi.ClientEventType

EventType returns the type of the event to log

func (ShowCmd) Exec

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

Exec executes the command

func (ShowCmd) Name

func (cmd ShowCmd) 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 TagsCmd

type TagsCmd struct{}

func (TagsCmd) ArgParser

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

func (TagsCmd) CreateMarkdown

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

func (TagsCmd) Description

func (cmd TagsCmd) Description() string

func (TagsCmd) Exec

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

func (TagsCmd) Name

func (cmd TagsCmd) Name() string

Jump to

Keyboard shortcuts

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