mysql

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 14 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.

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 Query

func Query(ctx context.Context, db *sql.DB, querySQL string) ([]string, []map[string]string, error)

Types

type MySQL

type MySQL struct {
	Ctx     context.Context
	MySQLDB *sql.DB
}

func NewMySQLDBEngine

func NewMySQLDBEngine(ctx context.Context, mysqlCfg config.MySQLConfig) (*MySQL, error)

func (*MySQL) FilterIntersectionMySQLTable

func (m *MySQL) FilterIntersectionMySQLTable(schemaName string, includeTables []string) ([]string, error)

func (*MySQL) GetMySQLDBServerCharacterSet

func (m *MySQL) GetMySQLDBServerCharacterSet() (string, error)

func (*MySQL) GetMySQLDBServerCollation

func (m *MySQL) GetMySQLDBServerCollation() (string, error)

func (*MySQL) GetMySQLDBVersion

func (m *MySQL) GetMySQLDBVersion() (string, error)

func (*MySQL) GetMySQLDataRowStrings

func (m *MySQL) GetMySQLDataRowStrings(querySQL string) ([]string, *strset.Set, uint32, error)

func (*MySQL) GetMySQLNormalTable

func (m *MySQL) GetMySQLNormalTable(schemaName string) ([]string, error)

func (*MySQL) GetMySQLPartitionTable

func (m *MySQL) GetMySQLPartitionTable(schemaName string) ([]string, error)

func (*MySQL) GetMySQLPartitionTableDetailINFO

func (m *MySQL) GetMySQLPartitionTableDetailINFO(schemaName, tableName string) (string, error)

func (*MySQL) GetMySQLPartitionTableINFO

func (m *MySQL) GetMySQLPartitionTableINFO(schemaName, tableName string) ([]map[string]string, error)

func (*MySQL) GetMySQLTable

func (m *MySQL) GetMySQLTable(schemaName string) ([]string, error)

func (*MySQL) GetMySQLTableActualRows

func (m *MySQL) GetMySQLTableActualRows(mysqlQuery string) (int64, error)

func (*MySQL) GetMySQLTableCharacterSetAndCollation

func (m *MySQL) GetMySQLTableCharacterSetAndCollation(schemaName, tableName string) (string, string, error)

func (*MySQL) GetMySQLTableCheckKey

func (m *MySQL) GetMySQLTableCheckKey(schemaName, tableName string) ([]map[string]string, error)

func (*MySQL) GetMySQLTableColumn

func (m *MySQL) GetMySQLTableColumn(schemaName, tableName string) ([]map[string]string, error)

func (*MySQL) GetMySQLTableColumnComment

func (m *MySQL) GetMySQLTableColumnComment(schemaName, tableName string) ([]map[string]string, error)

func (*MySQL) GetMySQLTableComment

func (m *MySQL) GetMySQLTableComment(schemaName, tableName string) ([]map[string]string, error)

func (*MySQL) GetMySQLTableForeignKey

func (m *MySQL) GetMySQLTableForeignKey(schemaName, tableName string) ([]map[string]string, error)

func (*MySQL) GetMySQLTableIndex

func (m *MySQL) GetMySQLTableIndex(schemaName, tableName string, targetDBTye string) ([]map[string]string, error)

func (*MySQL) GetMySQLTableName

func (m *MySQL) GetMySQLTableName(schemaName, tableName string) ([]string, error)

func (*MySQL) GetMySQLTableNormalIndex added in v1.0.9

func (m *MySQL) GetMySQLTableNormalIndex(schemaName, tableName string, targetDBTye string) ([]map[string]string, error)

func (*MySQL) GetMySQLTableOriginDDL added in v1.0.13

func (m *MySQL) GetMySQLTableOriginDDL(schemaName, tableName string) (string, error)

func (*MySQL) GetMySQLTablePrimaryKey

func (m *MySQL) GetMySQLTablePrimaryKey(schemaName, tableName string) ([]map[string]string, error)

func (*MySQL) GetMySQLTableUniqueKey

func (m *MySQL) GetMySQLTableUniqueKey(schemaName, tableName string) ([]map[string]string, error)

func (*MySQL) GetMySQLViewTable

func (m *MySQL) GetMySQLViewTable(schemaName string) ([]string, error)

func (*MySQL) GetTiDBAlterPKValue

func (m *MySQL) GetTiDBAlterPKValue() (string, error)

func (*MySQL) GetTiDBClusteredIndexValue

func (m *MySQL) GetTiDBClusteredIndexValue() (string, error)

func (*MySQL) IsExistMySQLSchema

func (m *MySQL) IsExistMySQLSchema(schemaName string) (bool, error)

func (*MySQL) IsExistMySQLTableCharacterSetAndCollation

func (m *MySQL) IsExistMySQLTableCharacterSetAndCollation(schemaName, tableName string) (bool, error)

func (*MySQL) IsExistMysqlIndex

func (m *MySQL) IsExistMysqlIndex(schemaName, tableName, indexName string) bool

func (*MySQL) IsMySQLPartitionTable

func (m *MySQL) IsMySQLPartitionTable(schemaName, tableName string) (bool, error)

func (*MySQL) RenameMySQLTableName

func (m *MySQL) RenameMySQLTableName(schemaName string, tableName string) error

func (*MySQL) TruncateMySQLTable

func (m *MySQL) TruncateMySQLTable(targetSchema string, targetTable string) error

func (*MySQL) WriteMySQLTable

func (m *MySQL) WriteMySQLTable(sql string) error

Jump to

Keyboard shortcuts

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