server

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: 17 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 NewEngineDB

func NewEngineDB(cfg *service.CfgFile) (*service.Engine, error)

数据库引擎初始化

func NewMySQLEngineGeneralDB

func NewMySQLEngineGeneralDB(mysqlCfg service.TargetConfig, slowQueryThreshold int) (*service.Engine, error)

func NewMySQLEnginePrepareDB

func NewMySQLEnginePrepareDB(mysqlCfg service.TargetConfig, slowQueryThreshold int) (*service.Engine, error)

创建 mysql 数据库引擎

func NewOracleDBEngine

func NewOracleDBEngine(oraCfg service.SourceConfig) (*sql.DB, error)

创建 oracle 数据库引擎

func Run

func Run(cfg *service.CfgFile, mode string) error

程序运行

Types

type Postgres

type Postgres struct {
	DB *sql.DB
}

func NewPostgresDSN

func NewPostgresDSN(dbUser, dbPassword, ipAddr, dbPort, dbName string) *Postgres

func (*Postgres) GetSchemaMeta

func (p *Postgres) GetSchemaMeta() (schemaMeta []string)

func (*Postgres) GetTableColumnMeta

func (p *Postgres) GetTableColumnMeta(schemaName string, tableName string) (colMeta []map[string]string)

func (*Postgres) GetTableForeignKey

func (p *Postgres) GetTableForeignKey(schemaName string, tableName string) (fkList []map[string]string)

func (*Postgres) GetTableIndexMeta

func (p *Postgres) GetTableIndexMeta(schemaName string, tableName string) (idxMeta []map[string]string)

func (*Postgres) GetTableMeta

func (p *Postgres) GetTableMeta(schemaName string) (tableMeta []map[string]string)

func (*Postgres) GetTablePrimaryKey

func (p *Postgres) GetTablePrimaryKey(schemaName string, tableName string) (pkList []map[string]string)

func (*Postgres) GetTableUniqueKey

func (p *Postgres) GetTableUniqueKey(schemaName string, tableName string) (ukList []map[string]string)

func (*Postgres) GetViewMeta

func (p *Postgres) GetViewMeta(schemaName, viewName string) (viewMeta []map[string]string)

func (*Postgres) QuerySQL

func (p *Postgres) QuerySQL(querySQL string) (cols []string, res []map[string]string)

Jump to

Keyboard shortcuts

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