commands

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DsnKey = "_gen:commands_"

Variables

View Source
var RegexMatchPkg = regexp.MustCompile(`([_a-zA-Z0-9]+)$`)

Functions

This section is empty.

Types

type Common

type Common struct {
	BaseDir                  string
	Dsn                      string
	Export, Prefix           string
	ModelPath, ModelPkg      string
	Override                 bool
	TargetPath, TargetPkg    string
	ModuleName, ModuleFolder string
}

func (*Common) BuildModule

func (o *Common) BuildModule(command *console.Command) (err error)

BuildModule build module name and working relative folder.

func (*Common) BuildScript

func (o *Common) BuildScript(command *console.Command) string

BuildScript build command runner script.

func (*Common) FormatColumn added in v1.0.4

func (o *Common) FormatColumn(command *console.Command, table *base.Table, column *base.Column, addColumnPkg bool)

func (*Common) FormatTable added in v1.0.4

func (o *Common) FormatTable(command *console.Command, table *base.Table)

func (*Common) FormatTableAsModel added in v1.0.4

func (o *Common) FormatTableAsModel(table *base.Table)

func (*Common) FormatTableAsService added in v1.0.4

func (o *Common) FormatTableAsService(table *base.Table)

func (*Common) ListTable

func (o *Common) ListTable(ctx context.Context, command *console.Command, addColumnPkg bool) (tables []*base.Table, err error)

ListTable returns a list for tables in a database.

func (*Common) ReadBaseDir

func (o *Common) ReadBaseDir(command *console.Command, key, value string) (err error)

ReadBaseDir read absolute path of the application.

func (*Common) ReadDsn

func (o *Common) ReadDsn(command *console.Command, key string) (err error)

ReadDsn read database source name.

func (*Common) ReadExport

func (o *Common) ReadExport(command *console.Command, key string) (err error)

ReadExport read export names.

func (*Common) ReadModelPath

func (o *Common) ReadModelPath(command *console.Command, key, value string) (err error)

ReadModelPath read path for model files location.

func (*Common) ReadOverride

func (o *Common) ReadOverride(command *console.Command, key string) (err error)

ReadOverride read override state for existing files.

func (*Common) ReadPrefix

func (o *Common) ReadPrefix(command *console.Command, key string) (err error)

ReadPrefix read prefix for table name.

func (*Common) ReadTargetPath

func (o *Common) ReadTargetPath(command *console.Command, key, value string) (err error)

ReadTargetPath read path for generated files save to.

func (*Common) RegisterDatabase

func (o *Common) RegisterDatabase() error

RegisterDatabase adds a database connect configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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