setup

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: BSD-3-Clause Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersion added in v1.3.5

func CompareVersion(version1 string, version2 string) int8

CompareVersion 对比版本

func ComposeSQLVersion

func ComposeSQLVersion() string

ComposeSQLVersion 组合SQL的版本号

func UpgradeSQLData

func UpgradeSQLData(db *dbs.DB) error

UpgradeSQLData 升级SQL数据

Types

type Config

type Config struct {
	APINodeProtocol string
	APINodeHost     string
	APINodePort     int
}

type SQLDump

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

func NewSQLDump

func NewSQLDump() *SQLDump

func (*SQLDump) Apply

func (this *SQLDump) Apply(db *dbs.DB, newResult *SQLDumpResult, showLog bool) (ops []string, err error)

Apply 应用数据

func (*SQLDump) Dump

func (this *SQLDump) Dump(db *dbs.DB, includingRecords bool) (result *SQLDumpResult, err error)

Dump 导出数据

func (*SQLDump) SetLogWriter added in v0.5.8

func (this *SQLDump) SetLogWriter(logWriter io.Writer)

type SQLDumpResult

type SQLDumpResult struct {
	Tables []*SQLTable `json:"tables"`
}

func (*SQLDumpResult) FindTable

func (this *SQLDumpResult) FindTable(tableName string) *SQLTable

type SQLExecutor

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

SQLExecutor 安装或升级SQL执行器

func NewSQLExecutor

func NewSQLExecutor(dbConfig *dbs.DBConfig) *SQLExecutor

func NewSQLExecutorFromCmd

func NewSQLExecutorFromCmd() (*SQLExecutor, error)

func (*SQLExecutor) Run

func (this *SQLExecutor) Run(showLog bool) error

func (*SQLExecutor) SetLogWriter added in v0.5.8

func (this *SQLExecutor) SetLogWriter(logWriter io.Writer)

type SQLField

type SQLField struct {
	Name       string `json:"name"`
	Definition string `json:"definition"`
}

func (*SQLField) EqualDefinition

func (this *SQLField) EqualDefinition(definition2 string) bool

type SQLIndex

type SQLIndex struct {
	Name       string `json:"name"`
	Definition string `json:"definition"`
}

type SQLRecord

type SQLRecord struct {
	Id           int64             `json:"id"`
	Values       map[string]string `json:"values"`
	UniqueFields []string          `json:"uniqueFields"`
	ExceptFields []string          `json:"exceptFields"`
}

func (*SQLRecord) ValuesEquals

func (this *SQLRecord) ValuesEquals(values maps.Map) bool

type SQLRecordsTable

type SQLRecordsTable struct {
	TableName    string
	UniqueFields []string
	ExceptFields []string
	IgnoreId     bool // 是否可以排除ID
}

type SQLTable

type SQLTable struct {
	Name       string       `json:"name"`
	Engine     string       `json:"engine"`
	Charset    string       `json:"charset"`
	Definition string       `json:"definition"`
	Fields     []*SQLField  `json:"fields"`
	Indexes    []*SQLIndex  `json:"indexes"`
	Records    []*SQLRecord `json:"records"`
}

func (*SQLTable) FindField

func (this *SQLTable) FindField(fieldName string) *SQLField

func (*SQLTable) FindIndex

func (this *SQLTable) FindIndex(indexName string) *SQLIndex

func (*SQLTable) FindRecord

func (this *SQLTable) FindRecord(id int64) *SQLRecord

type Setup

type Setup struct {

	// 要返回的数据
	AdminNodeId     string
	AdminNodeSecret string
	// contains filtered or unexported fields
}

func NewSetup

func NewSetup(config *Config) *Setup

func NewSetupFromCmd

func NewSetupFromCmd() *Setup

func (*Setup) Run

func (this *Setup) Run() error

Jump to

Keyboard shortcuts

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