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.
Index ¶
- func GetOracleConstraint(schemaName, tableName string, oracle *oracle.Oracle) ([]public.ConstraintPUKey, []public.ConstraintForeign, []public.ConstraintCheck, ...)
- func GetOracleTableColumn(schemaName, tableName string, oracle *oracle.Oracle, ...) (map[string]public.Column, string, error)
- func GetOracleTableIndex(schemaName, tableName string, oracle *oracle.Oracle) ([]public.Index, error)
- func NewMySQLTableINFO(schemaName, tableName, targetDBType string, mysql *mysql.MySQL) (*public.Table, string, error)
- func NewOracleTableINFO(schemaName, tableName string, oracle *oracle.Oracle, ...) (*public.Table, error)
- func OracleTableColumnMapRuleCheck(sourceSchema, targetSchema, tableName, columnName string, ...) (string, table.Row, error)
- type Check
- type Diff
- func (c *Diff) CheckCheckKey() (string, error)
- func (c *Diff) CheckColumn() (string, error)
- func (c *Diff) CheckColumnCharacterSetAndCollation() string
- func (c *Diff) CheckColumnCounts() (string, error)
- func (c *Diff) CheckForeignKey() (string, error)
- func (c *Diff) CheckIndex() (string, error)
- func (c *Diff) CheckPartitionTable() (string, error)
- func (c *Diff) CheckPartitionTableType() string
- func (c *Diff) CheckPrimaryAndUniqueKey() (string, error)
- func (c *Diff) CheckTableCharacterSetAndCollation() string
- func (c *Diff) CheckTableComment() string
- func (c *Diff) String() string
- func (c *Diff) Writer(f *check.File) error
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOracleConstraint ¶
func GetOracleConstraint(schemaName, tableName string, oracle *oracle.Oracle) ([]public.ConstraintPUKey, []public.ConstraintForeign, []public.ConstraintCheck, error)
func GetOracleTableColumn ¶
func GetOracleTableIndex ¶
func NewMySQLTableINFO ¶
func NewOracleTableINFO ¶
Types ¶
type Diff ¶
type Diff struct { Ctx context.Context DBTypeS string `json:"db_type_s"` DBTypeT string `json:"db_type_t"` OracleTableINFO *public.Table `json:"oracle_table_info"` MySQLTableINFO *public.Table `json:"mysql_table_info"` MySQLDBVersion string `json:"mysqldb_version"` MetaDB *meta.Meta `json:"-"` }
func NewChecker ¶
func (*Diff) CheckCheckKey ¶
func (*Diff) CheckColumn ¶
func (*Diff) CheckColumnCharacterSetAndCollation ¶
func (*Diff) CheckColumnCounts ¶
func (*Diff) CheckForeignKey ¶
func (*Diff) CheckIndex ¶
func (*Diff) CheckPartitionTable ¶
func (*Diff) CheckPartitionTableType ¶
表结构对比 以上游 oracle 表结构信息为基准,对比下游 MySQL 表结构 1、若上游存在,下游不存在,则输出记录,若上游不存在,下游存在,则默认不输出 2、忽略上下游不同索引名、约束名对比,只对比下游是否存在同等约束下同等字段是否存在 3、分区只对比分区类型、分区键、分区表达式等,不对比具体每个分区下的情况
func (*Diff) CheckPrimaryAndUniqueKey ¶
func (*Diff) CheckTableCharacterSetAndCollation ¶
func (*Diff) CheckTableComment ¶
type Task ¶
type Task struct { SourceSchemaName string `json:"source_schema_name"` TargetSchemaName string `json:"target_schema_name"` SourceTableName string `json:"source_table_name"` TargetTableName string `json:"target_table_name"` SourceDBCharacterSet string `json:"source_db_character_set"` SourceDBNLSSort string `json:"source_dbnls_sort"` SourceDBNLSComp string `json:"source_dbnls_comp"` SourceDBCollation bool `json:"source_db_collation"` SourceTableCollation string `json:"source_table_collation"` SourceSchemaCollation string `json:"source_schema_collation"` Oracle *oracle.Oracle `json:"-"` MySQL *mysql.MySQL `json:"-"` }
func GenCheckTaskTable ¶
func GenCheckTaskTable(sourceSchemaName, targetSchemaName, sourceDBCharacterSet, nlsSort, nlsComp string, sourceTableCollation map[string]string, sourceSchemaCollation string, sourceDBCollation bool, oracle *oracle.Oracle, mysql *mysql.MySQL, tableNameRule map[string]string, waitSyncMetas []meta.WaitSyncMeta) []*Task