database

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 12 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDataCompareProcess

func IDataCompareProcess(p IDataCompareProcessor) error

func IDataMigrateProcess

func IDataMigrateProcess(p IDataMigrateProcessor) error

func IDataScanProcess

func IDataScanProcess(p IDataScanProcessor) error

func IDatabaseRun added in v0.0.9

func IDatabaseRun(i IDatabaseRunner) error

func IStructCompareProcessor

func IStructCompareProcessor(p IDatabaseStructCompareProcessor, ignoreCase bool) (*structure.Table, error)

default origin object:

SchemaName         string
TableName          string

func IStructCompareTable

func IStructCompareTable(dsct IDatabaseStructCompareTable) (string, error)

Types

type DataCompareAttributesRule

type DataCompareAttributesRule struct {
	SchemaNameS            string            `json:"schemaNameS"`
	SchemaNameT            string            `json:"schemaNameT"`
	TableNameS             string            `json:"tableNameS"`
	TableTypeS             string            `json:"tableTypeS"`
	TableNameT             string            `json:"tableNameT"`
	ColumnDetailSO         string            `json:"columnDetailSO"`
	ColumnDetailS          string            `json:"columnDetailS"`
	ColumnDetailT          string            `json:"columnDetailT"`
	ColumnDetailTO         string            `json:"columnDetailTO"`
	CompareMethod          string            `json:"compareMethod"`
	ColumnNameRouteRule    map[string]string `json:"columnNameRouteRule"` // keep the column name upstream and downstream mapping, a -> b
	CompareConditionFieldS string            `json:"compareConditionFieldS"`
	CompareConditionRangeS string            `json:"compareConditionRangeS"`
	CompareConditionRangeT string            `json:"compareConditionRangeT"`
	IgnoreConditionFields  []string          `json:"ignoreConditionFields"`
	SqlHintS               string            `json:"sqlHintS"`
	SqlHintT               string            `json:"sqlHintT"`
}

type DataMigrateAttributesRule

type DataMigrateAttributesRule struct {
	SchemaNameS         string `json:"schemaNameS"`
	SchemaNameT         string `json:"schemaNameT"`
	TableNameS          string `json:"tableNameS"`
	TableTypeS          string `json:"tableTypeS"`
	TableNameT          string `json:"tableNameT"`
	ColumnDetailO       string `json:"columnDetailO"`
	ColumnDetailS       string `json:"columnDetailS"`
	ColumnDetailT       string `json:"columnDetailT"`
	EnableChunkStrategy bool   `json:"enableChunkStrategy"`
	SqlHintS            string `json:"sqlHintS"`
	WhereRange          string `json:"whereRange"`
}

type DataScanAttributesRule

type DataScanAttributesRule struct {
	SchemaNameS      string `json:"schemaNameS"`
	TableNameS       string `json:"tableNameS"`
	ColumnDetailS    string `json:"columnDetailS"`
	GroupColumnS     string `json:"groupColumnS"`
	TableTypeS       string `json:"tableTypeS"`
	TableSamplerateS string `json:"tableSamplerateS"`
	SqlHintS         string `json:"sqlHintS"`
}

type IDataCompareProcessor

type IDataCompareProcessor interface {
	CompareMethod() string
	CompareRows() error
	CompareMd5ORCrc32() error
	CompareCRC32() error
}

type IDataCompareRuleInitializer

type IDataCompareRuleInitializer interface {
	GenSchemaTableCompareMethodRule() string
	GenSchemaTableCustomRule() (string, string, string, []string, string, string, error)
	IDatabaseSchemaTableRule
}

IDataCompareRuleInitializer used for database table rule initializer

type IDataMigrateProcessor

type IDataMigrateProcessor interface {
	MigrateRead() error
	MigrateProcess() error
	MigrateApply() error
}

type IDataMigrateRuleInitializer

type IDataMigrateRuleInitializer interface {
	GenSchemaTableCustomRule() (bool, string, string, error)
	IDatabaseSchemaTableRule
}

IDataMigrateRuleInitializer used for database table rule initializer

type IDataScanProcessor

type IDataScanProcessor interface {
	ScanRows() error
}

type IDataScanRuleInitializer

type IDataScanRuleInitializer interface {
	GenSchemaNameRule() (string, error)
	GenTableNameRule() (string, error)
	GenTableColumnNameRule() (string, string, error)
	GenSchemaTableCustomRule() (string, string, error)
	GenSchemaTableTypeRule() string
}

IDataScanRuleInitializer used for database table rule initializer

type IDatabase

type IDatabase interface {
	PrepareContext(ctx context.Context, sqlStr string) (*sql.Stmt, error)
	QueryContext(ctx context.Context, sqlStr string, args ...any) (*sql.Rows, error)
	BeginTxn(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
	Transaction(ctx context.Context, opts *sql.TxOptions, fns []func(ctx context.Context, tx *sql.Tx) error) error
	CommitTxn(txn *sql.Tx) error
	ExecContext(ctx context.Context, sqlStr string, args ...any) (sql.Result, error)
	GeneralQuery(sqlStr string, args ...any) ([]string, []map[string]string, error)
	PingDatabaseConnection() error
	Close() error
	IDatabaseTableFilter
	IDatabaseAssessMigrate
	IDatabaseStructMigrate
	IDatabaseSequenceMigrate
	IDatabaseDataMigrate
	IDatabaseDataCompare
	IDatabaseStructCompare
}

func NewDatabase

func NewDatabase(ctx context.Context, datasource *datasource.Datasource, migrateOracleSchema string, callTimeout int64) (IDatabase, error)

type IDatabaseAssessMigrate

type IDatabaseAssessMigrate interface {
	GetDatabaseSoftVersion() (string, error)
	GetDatabasePlatformName() (string, string, string, error)
	GetDatabaseGlobalName() (string, error)
	GetDatabaseParameters() (string, string, string, string, error)
	GeDatabaseInstance() ([]map[string]string, error)
	GetDatabaseSize() (string, error)
	GetDatabaseSchemaNameALL() ([]string, error)
	GetDatabaseSchemaNameSingle(schemaNameS string) (string, error)
	GetDatabaseServerNumCPU() (string, error)
	GetDatabaseServerMemorySize() (string, error)
	GetDatabaseSessionMaxActiveCount() ([]map[string]string, error)
	GetDatabaseSchemaTableIndexOverview(schemaNameS []string) ([]map[string]string, error)
	GetDatabaseSchemaTableRowsTOP(schemaName []string, top int) ([]map[string]string, error)
	GetDatabaseSchemaCodeObject(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaPartitionTableType(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaTableAvgRowLengthTOP(schemaName []string, top int) ([]map[string]string, error)
	GetDatabaseSchemaSynonymObject(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaMaterializedViewObject(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaPartitionTableCountsOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableAvgRowLengthOverLimitMB(schemaName []string, limitMB int) ([]map[string]string, error)
	GetDatabaseSchemaTableIndexLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableColumnCountsOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableIndexCountsOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseUsernameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableColumnNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableIndexNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableViewNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableSequenceNameLengthOverLimit(schemaName []string, limit int) ([]map[string]string, error)
	GetDatabaseSchemaTableTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaColumnDataDefaultCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaViewTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaObjectTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaPartitionTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaSubPartitionTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaTemporaryTableTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaConstraintTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaIndexTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaColumnTypeCounts(schemaName []string) ([]map[string]string, error)
	GetDatabaseSchemaTableSpecialDatatype(schemaName []string, specialDatatype string) ([]map[string]string, error)
}

IDatabaseAssessMigrate used for database assess migrate

type IDatabaseDataCompare

type IDatabaseDataCompare interface {
	GetDatabaseTableConstraintIndexColumn(schemaNameS, tableNameS string) (map[string]string, error)
	GetDatabaseTableStatisticsBucket(schemeNameS, tableNameS string, consColumns map[string]string) (map[string][]structure.Bucket, map[string]string, error)
	GetDatabaseTableStatisticsHistogram(schemeNameS, tableNameS string, consColumns map[string]string) (map[string]structure.Histogram, error)
	GetDatabaseTableColumnProperties(schemaNameS, tableNameS string, columnNameSli []string) ([]map[string]string, error)
	GetDatabaseTableHighestSelectivityIndex(schemaNameS, tableNameS string, compareCondField string, ignoreCondFields []string) (*structure.Selectivity, error)
	GetDatabaseTableRandomValues(schemaNameS, tableNameS string, columns []string, conditions string, condArgs []interface{}, limit int, collations []string) ([][]string, error)
	GetDatabaseTableCompareRow(query string, args ...any) ([]string, []map[string]string, error)
	GetDatabaseTableCompareCrc(querySQL string, callTimeout int, dbCharsetS, dbCharsetT, separator string, queryArgs []interface{}) ([]string, uint32, map[string]int64, error)
}

type IDatabaseDataMigrate

type IDatabaseDataMigrate interface {
	GetDatabaseRole() (string, error)
	GetDatabaseVersion() (string, error)
	GetDatabaseCharset() (string, error)
	GetDatabaseTableType(schemaName string) (map[string]string, error)
	GetDatabaseTableColumnInfo(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableColumnNameTableDimensions(schemaName, tableName string) ([]string, error)
	GetDatabaseTableColumnNameSqlDimensions(sqlStr string) ([]string, map[string]string, map[string]string, error)
	GetDatabaseTableRows(schemaName, tableName string) (uint64, error)
	GetDatabaseTableSize(schemaName, tableName string) (float64, error)
	GetDatabaseTableChunkTask(taskName, schemaName, tableName string, chunkSize uint64, callTimeout uint64, batchSize int, dataChan chan []map[string]string) error
	GetDatabaseTableStmtData(querySQL string, queryArgs []interface{}, batchSize, callTimeout int, dbCharsetS, dbCharsetT, columnDetailO string, dataChan chan []interface{}) error
	GetDatabaseTableNonStmtData(taskFlow, querySQL string, queryArgs []interface{}, batchSize, callTimeout int, dbCharsetS, dbCharsetT, columnDetailO string, dataChan chan []interface{}) error
	GetDatabaseTableCsvData(querySQL string, queryArgs []interface{}, callTimeout int, taskFlow, dbCharsetS, dbCharsetT, columnDetailO string, escapeBackslash bool, nullValue, separator, delimiter string, dataChan chan []string) error
	IDatabaseDataMigrateSnapshot
}

IDatabaseDataMigrate used for database table data migrate

type IDatabaseDataMigrateSnapshot added in v0.0.15

type IDatabaseDataMigrateSnapshot interface {
	GetDatabaseConsistentPos(ctx context.Context, tx *sql.Tx) (string, error)
}

type IDatabaseRunner added in v0.0.9

type IDatabaseRunner interface {
	Init() error
	Run() error
	Resume() error
	Last() error
}

IDatabaseRunner used for database table migrate runner

type IDatabaseSchemaTableRule

type IDatabaseSchemaTableRule interface {
	GenSchemaTableTypeRule() string
	GenSchemaNameRule() (string, string, error)
	GenSchemaTableNameRule() (string, string, error)
	GetSchemaTableColumnNameRule() (map[string]string, error)
	GenSchemaTableColumnSelectRule() (string, string, string, string, error)
}

type IDatabaseSequenceMigrate

type IDatabaseSequenceMigrate interface {
	GetDatabaseSequences(schemaName string) ([]string, error)
	GetDatabaseSequenceName(schemaName string, seqName string) ([]map[string]string, error)
}

type IDatabaseStructCompare

type IDatabaseStructCompare interface {
	GetDatabaseTablePartitionExpress(schemaName string, tableName string) ([]map[string]string, error)
}

IDatabaseStructCompare used for database table struct migrate

type IDatabaseStructCompareProcessor

type IDatabaseStructCompareProcessor interface {
	GenDatabaseSchemaTable() (string, string)
	GenDatabaseTableCollation() (string, error)
	GenDatabaseTableCharset() (string, error)
	GenDatabaseTableComment() (string, error)
	GenDatabaseTableColumnDetail() (map[string]structure.NewColumn, map[string]map[string]structure.OldColumn, error)
	GenDatabaseTableIndexDetail() (map[string]structure.Index, error)
	GenDatabaseTablePrimaryConstraintDetail() (map[string]structure.ConstraintPrimary, error)
	GenDatabaseTableUniqueConstraintDetail() (map[string]structure.ConstraintUnique, error)
	GenDatabaseTableForeignConstraintDetail() (map[string]structure.ConstraintForeign, error)
	GenDatabaseTableCheckConstraintDetail() (map[string]structure.ConstraintCheck, error)
	GenDatabaseTablePartitionDetail() ([]structure.Partition, error)
}

type IDatabaseStructCompareTable

type IDatabaseStructCompareTable interface {
	ComparePartitionTableType() string
	CompareTableComment() string
	CompareTableCharsetCollation() string
	CompareTableColumnCharsetCollation() string
	CompareTableColumnCounts() string
	CompareTableIndexCounts() string
	CompareTablePrimaryConstraint() (string, error)
	CompareTableUniqueConstraint() (string, error)
	CompareTableForeignConstraint() (string, error)
	CompareTableCheckConstraint() (string, error)
	CompareTableIndexDetail() (string, error)
	CompareTableColumnDetail() (string, error)
	CompareTablePartitionDetail() (string, error)
}

type IDatabaseStructMigrate

type IDatabaseStructMigrate interface {
	GetDatabaseSchema() ([]string, error)
	GetDatabaseTable(schemaName string) ([]string, error)
	GetDatabaseCharset() (string, error)
	GetDatabaseCollation() (string, error)
	GetDatabaseVersion() (string, error)
	GetDatabasePartitionTable(schemaName string) ([]string, error)
	GetDatabaseTemporaryTable(schemaName string) ([]string, error)
	GetDatabaseClusteredTable(schemaName string) ([]string, error)
	GetDatabaseMaterializedView(schemaName string) ([]string, error)
	GetDatabaseNormalView(schemaName string) ([]string, error)
	GetDatabaseCompositeTypeTable(schemaName string) ([]string, error)
	GetDatabaseExternalTable(schemaName string) ([]string, error)
	GetDatabaseTableType(schemaName string) (map[string]string, error)
	GetDatabaseTableColumnInfo(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTablePrimaryKey(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableUniqueKey(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableForeignKey(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableCheckKey(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableNormalIndex(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableUniqueIndex(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableComment(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableColumnComment(schemaName string, tableName string) ([]map[string]string, error)
	GetDatabaseTableCharset(schemaName string, tableName string) (string, error)
	GetDatabaseTableCollation(schemaName, tableName string) (string, error)
	GetDatabaseSchemaCollation(schemaName string) (string, error)
	GetDatabaseTableOriginStruct(schemaName, tableName, tableType string) (string, error)
}

IDatabaseStructMigrate used for database table struct migrate

type IDatabaseTableFilter added in v0.0.6

type IDatabaseTableFilter interface {
	FilterDatabaseTable(sourceSchema string, includeTableS, excludeTableS []string) (*structure.TableObjects, error)
	FilterDatabaseSequence(sourceSchema string, includeSequenceS, excludeSequenceS []string) (*structure.SequenceObjects, error)
}

type IFileWriter

type IFileWriter interface {
	InitFile() error
	SyncFile() error
	Close() error
}

type ISequenceMigrateDatabaseWriter

type ISequenceMigrateDatabaseWriter interface {
	WriteSequenceDatabase() error
	SyncSequenceDatabase() error
}

type ISqlMigrateRuleInitializer

type ISqlMigrateRuleInitializer interface {
	GenSqlMigrateSchemaNameRule() (string, error)
	GenSqlMigrateTableNameRule() (string, error)
	GenSqlMigrateTableColumnRule() (string, string, string, error)
	GenSqlMigrateTableCustomRule() (string, string)
}

ISqlMigrateRuleInitializer used for database table rule initializer

type IStructMigrateAttributesProcessor

type IStructMigrateAttributesProcessor interface {
	GenSchemaNameS() string
	GenTableNameS() string
	GenTableTypeS() string
	GenTableOriginDDlS() string
	GenSchemaNameT() (string, error)
	GenTableNameT() (string, error)
	GenTableCreatePrefixT() string
	GenTableSuffix() (string, error)
	GenTablePrimaryKey() (string, error)
	GenTableUniqueKey() ([]string, error)
	GenTableForeignKey() ([]string, error)
	GenTableCheckKey() ([]string, error)
	GenTableUniqueIndex() ([]string, []string, error)
	GenTableNormalIndex() ([]string, []string, error)
	GenTableComment() (string, error)
	GenTableColumns() ([]string, error)
	GenTableColumnComment() ([]string, error)
}

type IStructMigrateAttributesReader

type IStructMigrateAttributesReader interface {
	GetTablePrimaryKey() ([]map[string]string, error)
	GetTableUniqueKey() ([]map[string]string, error)
	GetTableForeignKey() ([]map[string]string, error)
	GetTableCheckKey() ([]map[string]string, error)
	GetTableUniqueIndex() ([]map[string]string, error)
	GetTableNormalIndex() ([]map[string]string, error)
	GetTableComment() ([]map[string]string, error)
	GetTableColumns() ([]map[string]string, error)
	GetTableColumnComment() ([]map[string]string, error)
	GetTableCharsetCollation() (string, string, error)
	GetTableOriginStruct() (string, error)
}

IStructMigrateAttributesReader used for database table attributes

type IStructMigrateAttributesRuleReader

type IStructMigrateAttributesRuleReader interface {
	GetCreatePrefixRule() string
	GetCaseFieldRule() string
	GetSchemaNameRule() (map[string]string, error)
	GetTableNameRule() (map[string]string, error)
	GetTableColumnRule() (map[string]string, map[string]string, map[string]string, error)
	GetTableAttributesRule() (string, error)
	GetTableCommentRule() (string, error)
	GetTableCharsetRule() (string, error)
	GetTableCollationRule() (string, error)
	GetTableColumnCollationRule() (map[string]string, error)
	GetTableColumnCharsetRule() (map[string]string, error)
	GetTableColumnCommentRule() (map[string]string, error)
}

type IStructMigrateDatabaseWriter

type IStructMigrateDatabaseWriter interface {
	WriteStructDatabase() error
	SyncStructDatabase() error
}

type IStructMigrateFileWriter

type IStructMigrateFileWriter interface {
	InitOutputFile() error
	SyncStructFile() error
	SyncSequenceFile() error
	Close() error
}

type SqlMigrateAttributesRule

type SqlMigrateAttributesRule struct {
	SchemaNameT   string `json:"schemaNameT"`
	TableNameT    string `json:"tableNameT"`
	ColumnDetailO string `json:"columnDetailO"`
	ColumnDetailS string `json:"columnDetailS"`
	ColumnDetailT string `json:"columnDetailT"`
	SqlHintT      string `json:"sqlHintS"`
	SqlQueryS     string `json:"sqlQueryS"`
}

type StructMigrateAttributes

type StructMigrateAttributes struct {
	TableCharset   string              `json:"tableCharset"`
	TableCollation string              `json:"tableCollation"`
	PrimaryKey     []map[string]string `json:"primaryKey"`
	UniqueKey      []map[string]string `json:"uniqueKey"`
	ForeignKey     []map[string]string `json:"foreignKey"`
	CheckKey       []map[string]string `json:"checkKey"`
	UniqueIndex    []map[string]string `json:"uniqueIndex"`
	NormalIndex    []map[string]string `json:"normalIndex"`
	TableComment   []map[string]string `json:"tableComment"`
	TableColumns   []map[string]string `json:"tableColumns"`
	ColumnComment  []map[string]string `json:"columnComment"`
	OriginStruct   string              `json:"originStruct"`
}

type StructMigrateAttributesRule

type StructMigrateAttributesRule struct {
	CreatePrefixRule       string            `json:"createPrefixRule"`
	CaseFieldRuleT         string            `json:"caseFieldRule"`
	SchemaNameRule         map[string]string `json:"schemaNameRule"`
	TableNameRule          map[string]string `json:"tableNameRule"`
	ColumnNameRule         map[string]string `json:"columnNameRule"`
	ColumnDatatypeRule     map[string]string `json:"columnDatatypeRule"`
	ColumnDefaultValueRule map[string]string `json:"columnDefaultValueRule"`
	ColumnCharsetRule      map[string]string `json:"columnCharsetRule"`
	ColumnCollationRule    map[string]string `json:"columnCollationRule"`
	ColumnCommentRule      map[string]string `json:"columnCommentRule"`
	TableCharsetRule       string            `json:"tableCharsetRule"`
	TableCollationRule     string            `json:"tableCollationRule"`
	TableAttrRule          string            `json:"tableAttrRule"`
	TableCommentRule       string            `json:"tableCommentRule"`
}

type TableStruct

type TableStruct struct {
	SchemaNameS          string   `json:"schemaNameS"`
	TableNameS           string   `json:"tableNameS"`
	TableTypeS           string   `json:"tableTypeS"`
	OriginDdlS           string   `json:"originDdlS"`
	SchemaNameT          string   `json:"schemaNameT"`
	TableNameT           string   `json:"tableNameT"`
	TableCreatePrefixT   string   `json:"tableCreatePrefixT"`
	TablePrimaryKey      string   `json:"tablePrimaryKey"`
	TableColumns         []string `json:"tableColumns"`
	TableUniqueKeys      []string `json:"tableUniqueKeys"`
	TableNormalIndexes   []string `json:"tableNormalIndexes"`
	TableUniqueIndexes   []string `json:"tableUniqueIndexes"`
	TableSuffix          string   `json:"tableSuffix"`
	TableComment         string   `json:"tableComment"`
	TableColumnComment   []string `json:"tableColumnComment"`
	TableCheckKeys       []string `json:"tableCheckKeys"`
	TableForeignKeys     []string `json:"tableForeignKeys"`
	TableIncompatibleDDL []string `json:"tableIncompatibleDDL"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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