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.
Index ¶
- Constants
- func OracleTableMapRuleCheck(sourceSchema, targetSchema, tableName, columnName string, ...) (string, table.Row, error)
- func OracleTableToMySQLMappingCheck(engine *service.Engine, cfg *service.CfgFile) error
- type Column
- type ColumnInfo
- type ConstraintCheck
- type ConstraintForeign
- type ConstraintPUKey
- type DiffWriter
- type FileMW
- type Index
- type IndexInfo
- type Partition
- type Table
Constants ¶
const ( OracleGBKCharacterSet = "GBK" OracleUTF8CharacterSet = "UTF8" // oracle collation 默认大小写敏感,a != A OracleCollationBin = "BIN" // MySQL 支持 check 约束版本 > 8.0.15 MySQLCheckConsVersion = "8.0.15" // MySQL 版本分隔符号 MySQLVersionDelimiter = "-" // MySQL 字符集/排序规则 MySQLCharacterSet = "utf8mb4" MySQLCollation = "utf8mb4_bin" // JSON 格式化某字段 ColumnsJSON = "column" IndexJSON = "index" PUConstraintJSON = "puk" FKConstraintJSON = "fk" CKConstraintJSON = "ck" PartitionJSON = "partition" )
Variables ¶
This section is empty.
Functions ¶
func OracleTableMapRuleCheck ¶
Types ¶
type ColumnInfo ¶
type ConstraintCheck ¶
type ConstraintCheck struct {
ConstraintExpression string
}
type ConstraintForeign ¶
type ConstraintPUKey ¶
type DiffWriter ¶
type DiffWriter struct {
SourceSchemaName string
TargetSchemaName string
TableName string
Engine *service.Engine
*FileMW
}
func NewDiffWriter ¶
func NewDiffWriter(sourceSchemaName, targetSchemaName, tableName string, engine *service.Engine, fileMW *FileMW) *DiffWriter
func (*DiffWriter) DiffOracleAndMySQLTable ¶
func (d *DiffWriter) DiffOracleAndMySQLTable() error
表结构对比 以上游 oracle 表结构信息为基准,对比下游 MySQL 表结构 1、若上游存在,下游不存在,则输出记录,若上游不存在,下游存在,则默认不输出 2、忽略上下游不同索引名、约束名对比,只对比下游是否存在同等约束下同等字段是否存在 3、分区只对比分区类型、分区键、分区表达式等,不对比具体每个分区下的情况
type Table ¶
type Table struct {
SchemaName string
TableName string
TableComment string
TableCharacterSet string
TableCollation string
Columns map[string]Column // KEY 字段名
Indexes []Index
PUConstraints []ConstraintPUKey
ForeignConstraints []ConstraintForeign
CheckConstraints []ConstraintCheck
IsPartition bool
Partitions []Partition // 获取分区键、分区类型以及子分区键、子分区类型
}