migrate

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2020 Marvin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAssessMigrate

func DeleteAssessMigrate(serverAddr string, name string) error

func DeleteCsvMigrate

func DeleteCsvMigrate(serverAddr string, name string) error

func DeleteDataCompare

func DeleteDataCompare(serverAddr string, name string) error

func DeleteDataScan

func DeleteDataScan(serverAddr string, name string) error

func DeleteSqlMigrate

func DeleteSqlMigrate(serverAddr string, name string) error

func DeleteStmtMigrate

func DeleteStmtMigrate(serverAddr string, name string) error

func DeleteStructCompare

func DeleteStructCompare(serverAddr string, name string) error

func DeleteStructMigrate

func DeleteStructMigrate(serverAddr string, name string) error

func GetAssessMigrate

func GetAssessMigrate(serverAddr string, name string) error

func GetCsvMigrate

func GetCsvMigrate(serverAddr string, name string) error

func GetDataCompare

func GetDataCompare(serverAddr string, name string) error

func GetDataScan

func GetDataScan(serverAddr string, name string) error

func GetSqlMigrate

func GetSqlMigrate(serverAddr string, name string) error

func GetStmtMigrate

func GetStmtMigrate(serverAddr string, name string) error

func GetStructCompare

func GetStructCompare(serverAddr string, name string) error

func GetStructMigrate

func GetStructMigrate(serverAddr string, name string) error

func UpsertAssessMigrate

func UpsertAssessMigrate(serverAddr string, file string) error

func UpsertCsvMigrate

func UpsertCsvMigrate(serverAddr string, file string) error

func UpsertDataCompare

func UpsertDataCompare(serverAddr string, file string) error

func UpsertDataScan

func UpsertDataScan(serverAddr string, file string) error

func UpsertSqlMigrate

func UpsertSqlMigrate(serverAddr string, file string) error

func UpsertStmtMigrate

func UpsertStmtMigrate(serverAddr string, file string) error

func UpsertStructCompare

func UpsertStructCompare(serverAddr string, file string) error

func UpsertStructMigrate

func UpsertStructMigrate(serverAddr string, file string) error

Types

type AssessConfig

type AssessConfig struct {
	TaskName        string `toml:"task-name" json:"taskName"`
	DatasourceNameS string `toml:"datasource-name-s" json:"datasourceNameS"`
	DatasourceNameT string `toml:"datasource-name-t" json:"datasourceNameT"`
	Comment         string `toml:"comment" json:"comment"`

	AssessMigrateParam `toml:"assess-migrate-param" json:"assessMigrateParam"`
}

func (*AssessConfig) String

func (d *AssessConfig) String() string

type AssessMigrateParam

type AssessMigrateParam struct {
	CaseFieldRuleS string `toml:"case-field-rule-s" json:"caseFieldRuleS"`
	SchemaNameS    string `toml:"schema-name-s" json:"schemaNameS"`
}

type CaseFieldRule

type CaseFieldRule struct {
	CaseFieldRuleS string `toml:"case-field-rule-s" json:"caseFieldRuleS"`
	CaseFieldRuleT string `toml:"case-field-rule-t" json:"caseFieldRuleT"`
}

type ColumnStructRule

type ColumnStructRule struct {
	SchemaNameS   string `toml:"schema-name-s" json:"schemaNameS"`
	TableNameS    string `toml:"table-name-s" json:"tableNameS"`
	ColumnNameS   string `toml:"column-name-s" json:"columnNameS"`
	ColumnTypeS   string `toml:"column-type-s" json:"columnTypeS"`
	ColumnTypeT   string `toml:"column-type-t" json:"columnTypeT"`
	DefaultValueS string `toml:"default-value-s" json:"defaultValueS"`
	DefaultValueT string `toml:"default-value-t" json:"defaultValueT"`
}

type CompareConfig

type CompareConfig struct {
	TaskName        string `toml:"task-name" json:"taskName"`
	DatasourceNameS string `toml:"datasource-name-s" json:"datasourceNameS"`
	DatasourceNameT string `toml:"datasource-name-t" json:"datasourceNameT"`
	Comment         string `toml:"comment" json:"comment"`

	CaseFieldRule    CaseFieldRule     `toml:"case-field-rule" json:"caseFieldRule"`
	SchemaRouteRule  SchemaRouteRule   `toml:"schema-route-rule" json:"schemaRouteRule"`
	DataCompareRules []DataCompareRule `toml:"data-compare-rules" json:"dataCompareRules"`
	DataCompareParam DataCompareParam  `toml:"data-compare-param" json:"dataCompareParam"`
}

func (*CompareConfig) String

func (d *CompareConfig) String() string

type CsvConfig

type CsvConfig struct {
	TaskName        string `toml:"task-name" json:"taskName"`
	DatasourceNameS string `toml:"datasource-name-s" json:"datasourceNameS"`
	DatasourceNameT string `toml:"datasource-name-t" json:"datasourceNameT"`
	Comment         string `toml:"comment" json:"comment"`

	CaseFieldRule    CaseFieldRule     `toml:"case-field-rule" json:"caseFieldRule"`
	SchemaRouteRule  SchemaRouteRule   `toml:"schema-route-rule" json:"schemaRouteRule"`
	DataMigrateRules []DataMigrateRule `toml:"data-migrate-rules" json:"dataMigrateRules"`
	CsvMigrateParam  CsvMigrateParam   `toml:"csv-migrate-param" json:"csvMigrateParam"`
}

func (*CsvConfig) String

func (c *CsvConfig) String() string

type CsvMigrateParam

type CsvMigrateParam struct {
	TableThread          uint64 `toml:"table-thread" json:"tableThread"`
	BatchSize            uint64 `toml:"batch-size" json:"batchSize"`
	DiskUsageFactor      string `toml:"disk-usage-factor" json:"diskUsageFactor"`
	Header               bool   `toml:"header" json:"header"`
	Separator            string `toml:"separator" json:"separator"`
	Terminator           string `toml:"terminator" json:"terminator"`
	DataCharsetT         string `toml:"data-charset-t" json:"dataCharsetT"`
	Delimiter            string `toml:"delimiter" json:"delimiter"`
	NullValue            string `toml:"null-value" json:"nullValue"`
	EscapeBackslash      bool   `toml:"escape-backslash" json:"escapeBackslash"`
	ChunkSize            uint64 `toml:"chunk-size" json:"chunkSize"`
	OutputDir            string `toml:"output-dir" json:"outputDir"`
	SqlThreadS           uint64 `toml:"sql-thread-s" json:"sqlThreadS"`
	SqlHintS             string `toml:"sql-hint-s" json:"sqlHintS"`
	CallTimeout          uint64 `toml:"call-timeout" json:"callTimeout"`
	EnableCheckpoint     bool   `toml:"enable-checkpoint" json:"enableCheckpoint"`
	EnableConsistentRead bool   `toml:"enable-consistent-read" json:"enableConsistentRead"`
}

type DataCompareParam

type DataCompareParam struct {
	TableThread          uint64 `toml:"table-thread" json:"tableThread"`
	BatchSize            uint64 `toml:"batch-size" json:"batchSize"`
	SqlThread            uint64 `toml:"sql-thread" json:"sqlThread"`
	SqlHintS             string `toml:"sql-hint-s" json:"sqlHintS"`
	SqlHintT             string `toml:"sql-hint-t" json:"sqlHintT"`
	CallTimeout          uint64 `toml:"call-timeout" json:"callTimeout"`
	EnableCheckpoint     bool   `toml:"enable-checkpoint" json:"enableCheckpoint"`
	EnableConsistentRead bool   `toml:"enable-consistent-read" json:"enableConsistentRead"`
	OnlyCompareRow       bool   `toml:"only-compare-row" json:"onlyCompareRow"`
	ConsistentReadPointS string `toml:"consistent-read-point-s" json:"consistentReadPointS"`
	ConsistentReadPointT string `toml:"consistent-read-point-t" json:"consistentReadPointT"`
}

type DataCompareRule

type DataCompareRule struct {
	TableNameS   string   `toml:"table-name-s" json:"tableNameS"`
	CompareField string   `toml:"compare-field" json:"compareField"`
	CompareRange string   `toml:"compare-range" json:"compareRange"`
	IgnoreFields []string `toml:"ignore-fields" json:"ignoreFields"`
}

type DataMigrateRule

type DataMigrateRule struct {
	TableNameS          string `toml:"table-name-s" json:"tableNameS"`
	EnableChunkStrategy bool   `toml:"enable-chunk-strategy" json:"enableChunkStrategy"`
	WhereRange          string `toml:"where-range" json:"WhereRange"`
	SqlHintS            string `toml:"sql-hint-s" json:"sqlHintS"`
}

type DataScanParam

type DataScanParam struct {
	TableThread          uint64 `toml:"table-thread" json:"tableThread"`
	BatchSize            uint64 `toml:"batch-size" json:"batchSize"`
	ChunkSize            uint64 `toml:"chunk-size" json:"chunkSize"`
	SqlThreadS           uint64 `toml:"sql-thread-s" json:"sqlThreadS"`
	SqlHintS             string `toml:"sql-hint-s" json:"sqlHintS"`
	TableSamplerateS     uint64 `toml:"table-samplerate-s" json:"tableSamplerateS"`
	CallTimeout          uint64 `toml:"call-timeout" json:"callTimeout"`
	EnableCheckpoint     bool   `toml:"enable-checkpoint" json:"enableCheckpoint"`
	EnableConsistentRead bool   `toml:"enable-consistent-read" json:"enableConsistentRead"`
}

type DataScanRule

type DataScanRule struct {
	TableNameS       string `toml:"table-name-s" json:"tableNameS"`
	SqlHintS         string `toml:"sql-hint-s" json:"sqlHintS"`
	TableSamplerateS uint64 `toml:"table-samplerate-s" json:"tableSamplerateS"`
}

type ScanConfig

type ScanConfig struct {
	TaskName        string `toml:"task-name" json:"taskName"`
	DatasourceNameS string `toml:"datasource-name-s" json:"datasourceNameS"`
	DatasourceNameT string `toml:"datasource-name-t" json:"datasourceNameT"`
	Comment         string `toml:"comment" json:"comment"`

	CaseFieldRule   CaseFieldRule   `toml:"case-field-rule" json:"caseFieldRule"`
	SchemaRouteRule SchemaRouteRule `toml:"schema-route-rule" json:"schemaRouteRule"`
	DataScanRules   []DataScanRule  `toml:"data-scan-rules" json:"dataScanRules"`
	DataScanParam   DataScanParam   `toml:"data-scan-param" json:"dataScanParam"`
}

func (*ScanConfig) String

func (c *ScanConfig) String() string

type SchemaRouteRule

type SchemaRouteRule struct {
	SchemaNameS   string   `toml:"schema-name-s" json:"schemaNameS"`
	SchemaNameT   string   `toml:"schema-name-t" json:"schemaNameT"`
	IncludeTableS []string `toml:"include-table-s" json:"includeTableS"`
	ExcludeTableS []string `toml:"exclude-table-s" json:"excludeTableS"`

	TableRouteRules []TableRouteRule `toml:"table-route-rules" json:"tableRouteRules"`
}

type SchemaStructRule

type SchemaStructRule struct {
	SchemaNameS   string `toml:"schema-name-s" json:"schemaNameS"`
	ColumnTypeS   string `toml:"column-type-s" json:"columnTypeS"`
	ColumnTypeT   string `toml:"column-type-t" json:"columnTypeT"`
	DefaultValueS string `toml:"default-value-s" json:"defaultValueS"`
	DefaultValueT string `toml:"default-value-t" json:"defaultValueT"`
}

type SqlConfig

type SqlConfig struct {
	TaskName        string `toml:"task-name" json:"taskName"`
	DatasourceNameS string `toml:"datasource-name-s" json:"datasourceNameS"`
	DatasourceNameT string `toml:"datasource-name-t" json:"datasourceNameT"`
	Comment         string `toml:"comment" json:"comment"`

	CaseFieldRule   CaseFieldRule    `toml:"case-field-rule" json:"caseFieldRule"`
	SqlMigrateRules []SqlMigrateRule `toml:"sql-migrate-rules" json:"sqlMigrateRules"`
	SqlMigrateParam SqlMigrateParam  `toml:"sql-migrate-param" json:"sqlMigrateParam"`
}

func (*SqlConfig) String

func (s *SqlConfig) String() string

type SqlMigrateParam

type SqlMigrateParam struct {
	BatchSize            uint64 `toml:"batch-size" json:"batchSize"`
	SqlThreadS           uint64 `toml:"sql-thread-s" json:"sqlThreadS"`
	SqlThreadT           uint64 `toml:"sql-thread-t" json:"sqlThreadT"`
	SqlHintT             string `toml:"sql-hint-t" json:"sqlHintT"`
	CallTimeout          uint64 `toml:"call-timeout" json:"callTimeout"`
	EnableConsistentRead bool   `toml:"enable-consistent-read" json:"enableConsistentRead"`
	EnableSafeMode       bool   `toml:"enable-safe-mode" json:"enableSafeMode"`
}

type SqlMigrateRule

type SqlMigrateRule struct {
	SqlQueryS        string            `toml:"sql-query-s" json:"sqlQueryS"`
	SchemaNameT      string            `toml:"schema-name-t" json:"schemaNameT"`
	TableNameT       string            `toml:"table-name-t" json:"tableNameT"`
	SqlHintT         string            `toml:"sql-hint-t" json:"sqlHintT"`
	ColumnRouteRules map[string]string `toml:"column-route-rules" json:"columnRouteRules"`
}

type StatementConfig

type StatementConfig struct {
	TaskName        string `toml:"task-name" json:"taskName"`
	DatasourceNameS string `toml:"datasource-name-s" json:"datasourceNameS"`
	DatasourceNameT string `toml:"datasource-name-t" json:"datasourceNameT"`
	Comment         string `toml:"comment" json:"comment"`

	CaseFieldRule         CaseFieldRule         `toml:"case-field-rule" json:"caseFieldRule"`
	SchemaRouteRule       SchemaRouteRule       `toml:"schema-route-rule" json:"schemaRouteRule"`
	DataMigrateRules      []DataMigrateRule     `toml:"data-migrate-rules" json:"dataMigrateRules"`
	StatementMigrateParam StatementMigrateParam `toml:"statement-migrate-param" json:"statementMigrateParam"`
}

func (*StatementConfig) String

func (d *StatementConfig) String() string

type StatementMigrateParam

type StatementMigrateParam struct {
	TableThread          uint64 `toml:"table-thread" json:"tableThread"`
	BatchSize            uint64 `toml:"batch-size" json:"batchSize"`
	ChunkSize            uint64 `toml:"chunk-size" json:"chunkSize"`
	SqlThreadS           uint64 `toml:"sql-thread-s" json:"sqlThreadS"`
	SqlHintS             string `toml:"sql-hint-s" json:"sqlHintS"`
	SqlThreadT           uint64 `toml:"sql-thread-t" json:"sqlThreadT"`
	SqlHintT             string `toml:"sql-hint-t" json:"sqlHintT"`
	CallTimeout          uint64 `toml:"call-timeout" json:"callTimeout"`
	EnableCheckpoint     bool   `toml:"enable-checkpoint" json:"enableCheckpoint"`
	EnableConsistentRead bool   `toml:"enable-consistent-read" json:"enableConsistentRead"`
	EnableSafeMode       bool   `toml:"enable-safe-mode" json:"enableSafeMode"`
}

type StructCompareConfig

type StructCompareConfig struct {
	TaskName        string `toml:"task-name" json:"taskName"`
	DatasourceNameS string `toml:"datasource-name-s" json:"datasourceNameS"`
	DatasourceNameT string `toml:"datasource-name-t" json:"datasourceNameT"`
	Comment         string `toml:"comment" json:"comment"`

	CaseFieldRule      CaseFieldRule      `toml:"case-field-rule" json:"caseFieldRule"`
	SchemaRouteRule    SchemaRouteRule    `toml:"schema-route-rule" json:"schemaRouteRule"`
	StructCompareParam StructCompareParam `toml:"struct-compare-param" json:"structCompareParam"`
	StructCompareRule  StructCompareRule  `toml:"struct-compare-rule" json:"structCompareRule"`
}

func (*StructCompareConfig) String

func (s *StructCompareConfig) String() string

type StructCompareParam

type StructCompareParam struct {
	CompareThread    int64 `toml:"compare-thread" json:"compareThread"`
	EnableCheckpoint bool  `toml:"enable-checkpoint" json:"enableCheckpoint"`
}

type StructCompareRule

type StructCompareRule struct {
	TaskStructRules   []TaskStructRule   `toml:"task-struct-rules" json:"taskStructRules"`
	SchemaStructRules []SchemaStructRule `toml:"schema-struct-rules" json:"schemaStructRules"`
	TableStructRules  []TableStructRule  `toml:"table-struct-rules" json:"tableStructRules"`
	ColumnStructRules []ColumnStructRule `toml:"column-struct-rules" json:"columnStructRules"`
}

type StructConfig

type StructConfig struct {
	TaskName        string `toml:"task-name" json:"taskName"`
	DatasourceNameS string `toml:"datasource-name-s" json:"datasourceNameS"`
	DatasourceNameT string `toml:"datasource-name-t" json:"datasourceNameT"`
	Comment         string `toml:"comment" json:"comment"`

	CaseFieldRule      CaseFieldRule      `toml:"case-field-rule" json:"caseFieldRule"`
	SchemaRouteRule    SchemaRouteRule    `toml:"schema-route-rule" json:"schemaRouteRule"`
	StructMigrateParam StructMigrateParam `toml:"struct-migrate-param" json:"structMigrateParam"`
	StructMigrateRule  StructMigrateRule  `toml:"struct-migrate-rule" json:"structMigrateRule"`
}

func (*StructConfig) String

func (s *StructConfig) String() string

type StructMigrateParam

type StructMigrateParam struct {
	MigrateThread      int64 `toml:"migrate-thread" json:"migrateThread"`
	CreateIfNotExist   bool  `toml:"create-if-not-exist" json:"createIfNotExist"`
	EnableDirectCreate bool  `toml:"enable-direct-create" json:"enableDirectCreate"`
	EnableCheckpoint   bool  `toml:"enable-checkpoint" json:"enableCheckpoint"`
}

type StructMigrateRule

type StructMigrateRule struct {
	TaskStructRules   []TaskStructRule   `toml:"task-struct-rules" json:"taskStructRules"`
	SchemaStructRules []SchemaStructRule `toml:"schema-struct-rules" json:"schemaStructRules"`
	TableStructRules  []TableStructRule  `toml:"table-struct-rules" json:"tableStructRules"`
	ColumnStructRules []ColumnStructRule `toml:"column-struct-rules" json:"columnStructRules"`
	TableAttrsRules   []TableAttrsRule   `toml:"table-attrs-rules" json:"tableAttrsRules"`
}

type TableAttrsRule

type TableAttrsRule struct {
	SchemaNameS string   `toml:"schema-name-s" json:"schemaNameS"`
	TableNamesS []string `toml:"table-names-s" json:"TableNamesS"`
	TableAttrsT string   `toml:"table-attrs-t" json:"tableAttrsT"`
}

type TableRouteRule

type TableRouteRule struct {
	TableNameS       string            `toml:"table-name-s" json:"tableNameS"`
	TableNameT       string            `toml:"table-name-t" json:"tableNameT"`
	ColumnRouteRules map[string]string `toml:"column-route-rules" json:"columnRouteRules"`
}

type TableStructRule

type TableStructRule struct {
	SchemaNameS   string `toml:"schema-name-s" json:"schemaNameS"`
	TableNameS    string `toml:"table-name-s" json:"tableNameS"`
	ColumnTypeS   string `toml:"column-type-s" json:"columnTypeS"`
	ColumnTypeT   string `toml:"column-type-t" json:"columnTypeT"`
	DefaultValueS string `toml:"default-value-s" json:"defaultValueS"`
	DefaultValueT string `toml:"default-value-t" json:"defaultValueT"`
}

type TaskStructRule

type TaskStructRule struct {
	ColumnTypeS   string `toml:"column-type-s" json:"columnTypeS"`
	ColumnTypeT   string `toml:"column-type-t" json:"columnTypeT"`
	DefaultValueS string `toml:"default-value-s" json:"defaultValueS"`
	DefaultValueT string `toml:"default-value-t" json:"defaultValueT"`
}

Jump to

Keyboard shortcuts

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