reverser

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: Apache-2.0 Imports: 15 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.

Index

Constants

View Source
const (
	DBTypeTiDB  = "TiDB"
	DBTypeMySQL = "MYSQL"
)

Variables

This section is empty.

Functions

func CompatibilityDBTips added in v1.0.4

func CompatibilityDBTips(file *FileMW, sourceSchema string, partition, temporary, clustered []string) error

func GenCreateSchema added in v1.0.4

func GenCreateSchema(file *FileMW, sourceSchema, targetSchema string) error

func ReverseOracleTableColumnMapRule

func ReverseOracleTableColumnMapRule(
	sourceSchema, sourceTableName, columnName, dataType, dataNullable, comments, dataDefault string,
	dataScaleValue, dataPrecisionValue, dataLengthValue string, engine *service.Engine) (string, error)

表数据类型转换

func ReverseOracleToMySQLTable

func ReverseOracleToMySQLTable(engine *service.Engine, cfg *service.CfgFile) error

Types

type FileMW added in v1.0.4

type FileMW struct {
	Mutex  sync.Mutex
	Writer io.Writer
}

func (*FileMW) Write added in v1.0.4

func (d *FileMW) Write(b []byte) (n int, err error)

type ReverseWriter added in v1.0.4

type ReverseWriter struct {
	DBType            string
	DBVersion         string
	CreateTable       string
	CreateUK          []string
	CreateFK          []string
	CreateCK          []string
	CreateUniqueIndex []string
	CreateNormalIndex []string
	CreateOtherIndex  []string
	ReverseTable      Table
	RevFileMW         *FileMW
	CompFileMW        *FileMW
}

func NewReverseWriter added in v1.0.4

func NewReverseWriter(t Table, revFileMW, compFileMW *FileMW) (*ReverseWriter, error)

func (*ReverseWriter) Reverse added in v1.0.4

func (d *ReverseWriter) Reverse() error

type Table

type Table struct {
	SourceSchemaName string
	TargetSchemaName string
	SourceTableName  string
	TargetTableName  string
	SourceTableType  string
	Overwrite        bool
	Engine           *service.Engine `json:"-"`
}

任务

func LoadOracleToMySQLTableList added in v1.0.4

func LoadOracleToMySQLTableList(engine *service.Engine, exporterTableSlice []string, sourceSchema, targetSchema string, overwrite bool) ([]Table, []string, []string, []string, error)

加载表列表

func (Table) GenCreateCKSQL added in v1.0.4

func (t Table) GenCreateCKSQL(modifyTableName string) ([]string, error)

func (Table) GenCreateFKSQL added in v1.0.4

func (t Table) GenCreateFKSQL(modifyTableName string) ([]string, error)

func (Table) GenCreateNonUniqueIndex added in v1.0.4

func (t Table) GenCreateNonUniqueIndex(modifyTableName string) ([]string, []string, error)

func (Table) GenCreateTableSQL added in v1.0.4

func (t Table) GenCreateTableSQL(modifyTableName string) (string, error)

func (Table) GenCreateUKSQL added in v1.0.4

func (t Table) GenCreateUKSQL(modifyTableName string) ([]string, error)

func (Table) GenCreateUniqueIndex added in v1.0.4

func (t Table) GenCreateUniqueIndex(modifyTableName string) ([]string, []string, error)

func (*Table) String added in v1.0.4

func (t *Table) String() string

Jump to

Keyboard shortcuts

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