db

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MySQL Type = iota
	PostgreSQL
	DataSourceFormat = "%s:%s@tcp(%s)/information_schema?charset=%s&parseTime=True&loc=Local"
	QuerySQL         = "SELECT COLUMN_NAME, DATA_TYPE, COLUMN_KEY, " +
		"IS_NULLABLE, COLUMN_TYPE, COLUMN_COMMENT " +
		"FROM COLUMNS WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataBase

type DataBase interface {
	Type() Type
	Close() error
	Connect() error
	SetInfo(info *Info)
	SetSchema(schema string)
	Tables() ([]string, error)
	DataBases() ([]string, error)
	GetColumns(tabName string) ([]*TableColumn, error)
}

type Info

type Info struct {
	HostIPAndPort string
	UserName      string
	Password      string
	Charset       string
	Type          Type
}

type TableColumn

type TableColumn struct {
	ColumnName    string
	DataType      string
	IsNullable    string
	ColumnKey     string
	ColumnType    string
	ColumnComment string
}

func (*TableColumn) Comment

func (t *TableColumn) Comment() string

func (*TableColumn) Name

func (t *TableColumn) Name() string

func (*TableColumn) Type

func (t *TableColumn) Type() string

type Type

type Type int8

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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