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.
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.
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.
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.
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.
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.
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.
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.
Index ¶
- func GenCompatibilityTable(f *reverse.File, sourceSchema string, ...) error
- func GenCreateSchema(f *reverse.File, sourceSchema, targetSchema string) error
- func IChanger(c reverse.Changer) (map[string]string, map[string]map[string]string, map[string]map[string]string, ...)
- func IWriter(f *reverse.File, w reverse.Writer) error
- func LoadColumnDefaultValueRule(columnName string, defaultValue string, ...) string
- func LoadDataTypeRuleUsingTableOrSchema(originColumnType string, buildInColumnType string, ...) string
- func MySQLTableColumnMapRule(sourceSchema, sourceTable string, column Column, ...) (string, string, error)
- func PreCheckCompatibility(cfg *config.Config, mysql *mysql.MySQL, exporters []string, ...) ([]string, map[string][]map[string]string, map[string]string, map[string]string, ...)
- type Change
- type Column
- type ColumnInfo
- type DDL
- type Info
- type Reverse
- type Rule
- func (r *Rule) GenCreateTableDDL() (interface{}, error)
- func (r *Rule) GenSchemaName() string
- func (r *Rule) GenTableCheckKey() (checkKeys []string, err error)
- func (r *Rule) GenTableColumn() (columnMetas []string, err error)
- func (r *Rule) GenTableColumnComment() (columnComments []string, err error)
- func (r *Rule) GenTableComment() (tableComment string, err error)
- func (r *Rule) GenTableForeignKey() (foreignKeys []string, err error)
- func (r *Rule) GenTableKeys() (tableKeyMetas []string, compatibilityIndexSQL []string, err error)
- func (r *Rule) GenTableName() string
- func (r *Rule) GenTableNormalIndex() (normalIndexes []string, compatibilityIndexSQL []string, err error)
- func (r *Rule) GenTablePrefix() (string, string)
- func (r *Rule) GenTablePrimaryKey() (primaryKeys []string, err error)
- func (r *Rule) GenTableSuffix() (string, error)
- func (r *Rule) GenTableUniqueIndex() (uniqueIndexes []string, compatibilityIndexSQL []string, err error)
- func (r *Rule) GenTableUniqueKey() (uniqueKeys []string, err error)
- func (r *Rule) String() string
- type Table
- func (t *Table) GetTableCheckKey() ([]map[string]string, error)
- func (t *Table) GetTableColumnComment() ([]map[string]string, error)
- func (t *Table) GetTableColumnMeta() ([]map[string]string, error)
- func (t *Table) GetTableComment() ([]map[string]string, error)
- func (t *Table) GetTableForeignKey() ([]map[string]string, error)
- func (t *Table) GetTableInfo() (interface{}, error)
- func (t *Table) GetTableNormalIndex() ([]map[string]string, error)
- func (t *Table) GetTablePartitionDetail() (string, error)
- func (t *Table) GetTablePrimaryKey() ([]map[string]string, error)
- func (t *Table) GetTableUniqueIndex() ([]map[string]string, error)
- func (t *Table) GetTableUniqueKey() ([]map[string]string, error)
- func (t *Table) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenCompatibilityTable ¶
func GenCreateSchema ¶
func LoadColumnDefaultValueRule ¶ added in v1.0.9
func LoadColumnDefaultValueRule(columnName string, defaultValue string, columnDefaultValueMapSlice []meta.BuildinColumnDefaultval, globalDefaultValueMapSlice []meta.BuildinGlobalDefaultval) string
func LoadDataTypeRuleUsingTableOrSchema ¶ added in v1.0.9
func LoadDataTypeRuleUsingTableOrSchema(originColumnType string, buildInColumnType string, tableDataTypeMapSlice []meta.TableDatatypeRule, schemaDataTypeMapSlice []meta.SchemaDatatypeRule) string
func MySQLTableColumnMapRule ¶
func MySQLTableColumnMapRule(sourceSchema, sourceTable string, column Column, buildinDatatypes []meta.BuildinDatatypeRule) (string, string, error)
MySQL 表字段映射转换 -> Reverse 阶段
Types ¶
type Change ¶ added in v1.0.8
type Change struct { Ctx context.Context `json:"-"` SourceSchemaName string `json:"source_schema_name"` TargetSchemaName string `json:"target_schema_name"` SourceTables []string `json:"source_tables"` Threads int `json:"threads"` MySQL *mysql.MySQL `json:"-"` MetaDB *meta.Meta `json:"-"` }
func (*Change) ChangeTableColumnDatatype ¶ added in v1.0.8
数据库查询获取自定义表结构转换规则 加载数据类型转换规则【处理字段级别、表级别、库级别数据类型映射规则】 数据类型转换规则判断,未设置自定义规则,默认采用内置默认字段类型转换
func (*Change) ChangeTableColumnDefaultValue ¶ added in v1.0.8
type ColumnInfo ¶ added in v1.0.8
type DDL ¶
type DDL struct { SourceSchemaName string `json:"source_schema"` SourceTableName string `json:"source_table_name"` SourceTableType string `json:"source_table_type"` TargetSchemaName string `json:"target_schema"` TargetTableName string `json:"target_table_name"` TablePrefix string `json:"table_prefix"` TableColumns []string `json:"table_columns"` TableKeys []string `json:"table_keys"` TableIndexes []string `json:"table_indexes"` TableSuffix string `json:"table_suffix"` TableComment string `json:"table_comment"` ColumnCommentDDL []string `json:"column_comment_ddl"` TableCheckKeys []string `json:"table_check_keys""` TableForeignKeys []string `json:"table_foreign_keys"` TableCompatibleDDL []string `json:"table_compatible_ddl"` TablePartitionDetail string `json:"table_partition_detail"` }
type Info ¶ added in v1.0.8
type Info struct { PrimaryKeyINFO []map[string]string `json:"primary_key_info"` UniqueKeyINFO []map[string]string `json:"unique_key_info"` ForeignKeyINFO []map[string]string `json:"foreign_key_info"` CheckKeyINFO []map[string]string `json:"check_key_info"` UniqueIndexINFO []map[string]string `json:"unique_index_info"` NormalIndexINFO []map[string]string `json:"normal_index_info"` TableCommentINFO []map[string]string `json:"table_comment_info"` TableColumnINFO []map[string]string `json:"table_column_info"` ColumnCommentINFO []map[string]string `json:"column_comment_info"` TablePartitionDetail string `json:"table_partition_detail"` }
type Reverse ¶ added in v1.0.8
type Reverse struct {
// contains filtered or unexported fields
}
func NewM2OReverse ¶
func (*Reverse) NewReverse ¶ added in v1.0.8
type Rule ¶
func (*Rule) GenCreateTableDDL ¶
func (*Rule) GenSchemaName ¶ added in v1.0.8
func (*Rule) GenTableCheckKey ¶
func (*Rule) GenTableColumn ¶
func (*Rule) GenTableColumnComment ¶
func (*Rule) GenTableComment ¶
func (*Rule) GenTableForeignKey ¶
func (*Rule) GenTableKeys ¶ added in v1.0.8
func (*Rule) GenTableName ¶ added in v1.0.8
func (*Rule) GenTableNormalIndex ¶
func (*Rule) GenTablePrefix ¶
func (*Rule) GenTablePrimaryKey ¶
func (*Rule) GenTableSuffix ¶ added in v1.0.8
func (*Rule) GenTableUniqueIndex ¶
func (*Rule) GenTableUniqueKey ¶
type Table ¶
type Table struct { Ctx context.Context `json:"-"` MySQLDBType string `json:"mysqldb_type"` OracleDBVersion string `json:"oracle_db_version"` OracleExtendedMode bool `json:"oracle_extended_mode"` SourceSchemaName string `json:"source_schema_name"` TargetSchemaName string `json:"target_schema_name"` SourceTableName string `json:"source_table_name"` TargetTableName string `json:"target_table_name"` IsPartition bool `json:"is_partition"` SourceTableCharacterSet string `json:"source_table_character_set"` SourceTableCollation string `json:"source_table_collation"` TableColumnDatatypeRule map[string]string `json:"table_column_datatype_rule"` TableColumnDefaultValRule map[string]string `json:"table_column_default_val_rule"` Overwrite bool `json:"overwrite"` Oracle *oracle.Oracle `json:"-"` MySQL *mysql.MySQL `json:"-"` MetaDB *meta.Meta `json:"-"` }