source

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClickHouse

type ClickHouse struct {
	// contains filtered or unexported fields
}

func NewClickHouse

func NewClickHouse(s *Source) *ClickHouse

func (*ClickHouse) Columns

func (c *ClickHouse) Columns(database, table string) (res []Column, err error)

func (*ClickHouse) Databases

func (c *ClickHouse) Databases() (res []string, err error)

func (*ClickHouse) Exec

func (c *ClickHouse) Exec(s string) (err error)

func (*ClickHouse) Query

func (c *ClickHouse) Query(s string) (res []map[string]interface{}, err error)

func (*ClickHouse) Tables

func (c *ClickHouse) Tables(database string) (res []string, err error)

type Column

type Column struct {
	Field string `json:"field"`
	Type  string `json:"type"`
}

type MySQL

type MySQL struct {
	// contains filtered or unexported fields
}

func NewMySQL

func NewMySQL(s *Source) *MySQL

func (*MySQL) Columns

func (c *MySQL) Columns(database, table string) (res []Column, err error)

func (*MySQL) Databases

func (c *MySQL) Databases() (res []string, err error)

func (*MySQL) Exec

func (c *MySQL) Exec(s string) (err error)

func (*MySQL) Query

func (c *MySQL) Query(s string) (res []map[string]interface{}, err error)

func (*MySQL) Tables

func (c *MySQL) Tables(database string) (res []string, err error)

type Operator

type Operator interface {
	Databases() ([]string, error)
	Tables(string) ([]string, error)
	Columns(string, string) ([]Column, error)
	Query(s string) (res []map[string]interface{}, err error)
	Exec(s string) error
}

func Instantiate

func Instantiate(s *Source) Operator

type Source

type Source struct {
	DSN      string
	URL      string
	UserName string
	Password string
	Typ      int
}

func (*Source) GetDSN

func (s *Source) GetDSN() string

Jump to

Keyboard shortcuts

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