adaptors

package
v0.0.0-...-a79a6e6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adaptor

type Adaptor interface {
	Scan() (DbMetaInfo, error)
}

func New

func New(config AdaptorConfig) (Adaptor, error)

type AdaptorConfig

type AdaptorConfig struct {
	Type, Username, Password, Host string
}

type Column

type Column struct {
	ColumnName    string
	ColumnType    string
	ColumnComment string
}

type DbMetaInfo

type DbMetaInfo struct {
	Schemas []Schema
}

type Mysql

type Mysql struct {
	ConecStr string
	Connc    *sql.DB
}

func NewMysqlClient

func NewMysqlClient(username, password, host string) (Mysql, error)

func (*Mysql) Close

func (my *Mysql) Close()

close conncection

func (Mysql) GetSchemaDetails

func (mysql Mysql) GetSchemaDetails() ([]string, error)

func (Mysql) GetTableDetails

func (mysql Mysql) GetTableDetails(dbname string, tableName string) (Table, error)

func (Mysql) GetTableNamesFromDB

func (mysql Mysql) GetTableNamesFromDB(dbname string) ([]string, error)

func (Mysql) Scan

func (my Mysql) Scan() (DbMetaInfo, error)

type Postgres

type Postgres struct {
	ConecStr string
	Connc    *sql.DB
}

func NewPostgresClient

func NewPostgresClient(username, password, host string) (Postgres, error)

BUG: solve Postgres client connection string error

func (Postgres) Close

func (pg Postgres) Close() error

func (Postgres) GetSchemaDetails

func (pg Postgres) GetSchemaDetails() ([]string, error)

func (Postgres) GetTableDetails

func (pg Postgres) GetTableDetails(dbname string, tableName string) (Table, error)

func (Postgres) GetTableNamesFromDB

func (pg Postgres) GetTableNamesFromDB(dbname string) ([]string, error)

func (Postgres) Scan

func (pg Postgres) Scan() (DbMetaInfo, error)

type Schema

type Schema struct {
	Name   string
	Tables []Table
}

type Table

type Table struct {
	Name string
	Cols []Column
}

Jump to

Keyboard shortcuts

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