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.
Index ¶
- func ChangeTableColumnDefaultValue(ctx context.Context, metaDB *meta.Meta, ...) (string, error)
- func ChangeTableColumnType(ctx context.Context, metaDB *meta.Meta, ...) (string, error)
- func GenOracleTableColumnMeta(ctx context.Context, metaDB *meta.Meta, ...) (string, error)
- func GetOracleConstraint(schemaName, tableName string, oracle *oracle.Oracle) ([]ConstraintPUKey, []ConstraintForeign, []ConstraintCheck, error)
- func GetOracleTableColumn(schemaName, tableName string, oracle *oracle.Oracle, ...) (map[string]Column, string, error)
- func OracleTableColumnMapRuleCheck(sourceSchema, targetSchema, tableName, columnName string, ...) (string, table.Row, error)
- type Check
- type Column
- type ColumnInfo
- type ConstraintCheck
- type ConstraintForeign
- type ConstraintPUKey
- 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 Index
- type IndexInfo
- type Partition
- type Table
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeTableColumnType ¶
func ChangeTableColumnType(ctx context.Context, metaDB *meta.Meta, dbTypeS, dbTypeT, sourceSchema, sourceTableName, columnName string, columnINFO Column) (string, error)
数据库查询获取自定义表结构转换规则 加载数据类型转换规则【处理字段级别、表级别、库级别数据类型映射规则】 数据类型转换规则判断,未设置自定义规则,默认采用内置默认字段类型转换
func GenOracleTableColumnMeta ¶
func GenOracleTableColumnMeta(ctx context.Context, metaDB *meta.Meta, dbTypeS, dbTypeT, sourceSchema, sourceTableName, columnName string, columnINFO Column) (string, error)
Oracle 表字段映射转换 -> Check 阶段
func GetOracleConstraint ¶
func GetOracleConstraint(schemaName, tableName string, oracle *oracle.Oracle) ([]ConstraintPUKey, []ConstraintForeign, []ConstraintCheck, error)
func GetOracleTableColumn ¶
Types ¶
type Check ¶
type Check struct {
// contains filtered or unexported fields
}
type Column ¶
type ColumnInfo ¶
type ConstraintCheck ¶
type ConstraintCheck struct {
ConstraintExpression string
}
type ConstraintForeign ¶
type ConstraintPUKey ¶
type Diff ¶ added in v1.0.10
type Diff struct { Ctx context.Context DBTypeS string `json:"db_type_s"` DBTypeT string `json:"db_type_t"` OracleTableINFO *Table `json:"oracle_table_info"` MySQLTableINFO *Table `json:"mysql_table_info"` MySQLDBVersion string `json:"mysqldb_version"` MySQLDBType string `json:"mysqldb_type"` MetaDB *meta.Meta `json:"-"` }
func NewChecker ¶
func (*Diff) CheckCheckKey ¶ added in v1.0.10
func (*Diff) CheckColumn ¶ added in v1.0.10
func (*Diff) CheckColumnCharacterSetAndCollation ¶ added in v1.0.10
func (*Diff) CheckColumnCounts ¶ added in v1.0.10
func (*Diff) CheckForeignKey ¶ added in v1.0.10
func (*Diff) CheckIndex ¶ added in v1.0.10
func (*Diff) CheckPartitionTable ¶ added in v1.0.10
func (*Diff) CheckPartitionTableType ¶ added in v1.0.10
func (*Diff) CheckPrimaryAndUniqueKey ¶ added in v1.0.10
func (*Diff) CheckTableCharacterSetAndCollation ¶ added in v1.0.10
func (*Diff) CheckTableComment ¶ added in v1.0.10
type Index ¶
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 // 获取分区键、分区类型以及子分区键、子分区类型 }
func NewMySQLTableINFO ¶
func NewOracleTableINFO ¶
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"` TargetDBType string `json:"target_db_type"` 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, targetDBType string, oracle *oracle.Oracle, mysql *mysql.MySQL, tableNameRule map[string]string, waitSyncMetas []meta.WaitSyncMeta) []*Task