reverse

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 6 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IReverse

func IReverse(r Reverser) error

Types

type Changer added in v1.0.8

type Changer interface {
	ChangeTableName() (map[string]string, error)
	ChangeTableColumnDatatype() (map[string]map[string]string, error)
	ChangeTableColumnDefaultValue() (map[string]map[string]string, error)
}

type File

type File struct {
	RFile   *os.File
	CFile   *os.File
	RWriter *bufio.Writer
	CWriter *bufio.Writer
	Mutex   *sync.Mutex

	MySQL  *mysql.MySQL
	Oracle *oracle.Oracle
}

func NewWriter

func NewWriter(reverseFile, compFile string, mysql *mysql.MySQL, oracle *oracle.Oracle) (*File, error)

func (*File) CWriteString

func (f *File) CWriteString(s string) (nn int, err error)

func (*File) Close

func (f *File) Close() error

func (*File) RWriteString

func (f *File) RWriteString(s string) (nn int, err error)

type Generator

type Generator interface {
	GenSchemaName() string
	GenTableName() string
	GenTablePrefix() (string, string)
	GenTableSuffix() (string, error)
	GenTableKeys() (tableKeys []string, compatibilityIndexSQL []string, err error)
	GenTablePrimaryKey() (primaryKeys []string, err error)
	GenTableUniqueKey() (uniqueKeys []string, err error)
	GenTableForeignKey() (foreignKeys []string, err error)
	GenTableCheckKey() (checkKeys []string, err error)
	GenTableUniqueIndex() (uniqueIndexes []string, compatibilityIndexSQL []string, err error)
	GenTableNormalIndex() (normalIndexes []string, compatibilityIndexSQL []string, err error)
	GenTableComment() (tableComment string, err error)
	GenTableColumn() (tableColumns []string, err error)
	GenTableColumnComment() (columnComments []string, err error)
	GenCreateTableDDL() (interface{}, error)
}

type Reader

type Reader interface {
	GetTablePrimaryKey() ([]map[string]string, error)
	GetTableUniqueKey() ([]map[string]string, error)
	GetTableForeignKey() ([]map[string]string, error)
	GetTableCheckKey() ([]map[string]string, error)
	GetTableUniqueIndex() ([]map[string]string, error)
	GetTableNormalIndex() ([]map[string]string, error)
	GetTableComment() ([]map[string]string, error)
	GetTableColumnMeta() ([]map[string]string, error)
	GetTableColumnComment() ([]map[string]string, error)
	GetTableInfo() (interface{}, error)
}

type Reverser

type Reverser interface {
	NewReverse() error
}

type Writer

type Writer interface {
	File(f *File) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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