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.
Index ¶
- func GeneralQuery(db *sql.DB, querySQL string) ([]string, []map[string]string, error)
- func GetAllTables(dbName string, engine *Engine) ([]string, error)
- func IsExistIndexWithInMysql(mysql *Engine, schemaName, tableName, indexName string) bool
- func IsExistSchemaWithInMysql(mysql *Engine, schemaName string) bool
- func IsExistTableWithInMysql(mysql *Engine, schemaName, tableName string) bool
- func IsExistViewWithInMysql(mysql *Engine, schemaName, viewName string) bool
- func RenameTableWithInMysql(mysql *Engine, schemaName, tableName string)
- type ConvertDB
- type Engine
- func (e *Engine) GetSchemaMeta() (schemaMeta []string)
- func (e *Engine) GetTableColumnMeta(schemaName string, tableName string) (colMeta []map[string]string)
- func (e *Engine) GetTableForeignKey(schemaName string, tableName string) (fkList []map[string]string)
- func (e *Engine) GetTableIndexMeta(schemaName string, tableName string) (idxMeta []map[string]string)
- func (e *Engine) GetTableMeta(schemaName string) (tableMeta []map[string]string)
- func (e *Engine) GetTablePrimaryKey(schemaName string, tableName string) (pkList []map[string]string)
- func (e *Engine) GetTableUniqueKey(schemaName string, tableName string) (ukList []map[string]string)
- func (e *Engine) GetViewMeta(schemaName, viewName string) (viewMeta []map[string]string)
- func (e *Engine) IsExistDbName(dbName string) bool
- func (e *Engine) QuerySQL(querySQL string) (cols []string, res []map[string]string, err error)
- type OperatorDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneralQuery ¶
General query returns table field columns and corresponding field row data
func GetAllTables ¶
GetAllTables gets all table name from db
func IsExistIndexWithInMysql ¶
func IsExistTableWithInMysql ¶
func IsExistViewWithInMysql ¶
func RenameTableWithInMysql ¶
Types ¶
type ConvertDB ¶
type ConvertDB interface { GetSchemaMeta() (schemaMeta []string) GetTableMeta(schemaName string) (tableMeta []map[string]string) GetViewMeta(schemaName, viewName string) (viewMeta []map[string]string) GetTableColumnMeta(schemaName string, tableName string) (colMeta []map[string]string) GetTablePrimaryKey(schemaName string, tableName string) (pkList []map[string]string) GetTableUniqueKey(schemaName string, tableName string) (ukList []map[string]string) GetTableForeignKey(schemaName string, tableName string) (fkList []map[string]string) GetTableIndexMeta(schemaName string, tableName string) (idxMeta []map[string]string) }