o2m

package
v1.0.5 Latest Latest
Warning

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

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

This section is empty.

Variables

This section is empty.

Functions

func CompatibilityDBTips

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

func GenCreateSchema

func GenCreateSchema(file *FileMW, engine *service.Engine, sourceSchema, targetSchema, nlsComp string) error

func OracleReverseToMySQLTable

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

func ReverseOracleTableColumnMapRule

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

Oracle 表字段映射转换 -> Reverse 阶段

Types

type FileMW

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

func (*FileMW) Write

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

type ReverseWriter

type ReverseWriter struct {
	DBType          string
	DBVersion       string
	CreateTable     string
	CreateFK        []string
	CreateCK        []string
	CreateCompIndex []string
	ReverseTable    Table
	RevFileMW       *FileMW
	CompFileMW      *FileMW
}

func NewReverseWriter

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

func (*ReverseWriter) Reverse

func (d *ReverseWriter) Reverse() error

func (*ReverseWriter) String

func (d *ReverseWriter) String() string

type Table

type Table struct {
	SourceSchemaName      string
	TargetSchemaName      string
	SourceTableName       string
	TargetDBType          string
	TargetTableName       string
	TargetTableOption     string
	OracleCollation       bool
	SourceSchemaCollation string // 可为空
	SourceTableCollation  string // 可为空
	SourceDBNLSSort       string
	SourceDBNLSComp       string
	SourceTableType       string
	Overwrite             bool
	Engine                *service.Engine `json:"-"`
}

任务

func GenOracleToMySQLTableList

func GenOracleToMySQLTableList(engine *service.Engine, cfg *config.CfgFile, exporterTableSlice []string, nlsSort, nlsComp string) ([]Table, []string, []string, []string, error)

表列表过滤 -> 不兼容性的

func (Table) GenCreateCKSQL

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

func (Table) GenCreateFKSQL

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

func (Table) GenCreateNonUniqueIndex

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

func (Table) GenCreateTableSQL

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

func (Table) GenCreateUKSQL

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

func (Table) GenCreateUniqueIndex

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

func (*Table) String

func (t *Table) String() string

Jump to

Keyboard shortcuts

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