sdata

package
v0.16.27 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFromEdgeNotFound   = errors.New("from edge not found")
	ErrToEdgeNotFound     = errors.New("to edge not found")
	ErrPathNotFound       = errors.New("path not found")
	ErrThoughNodeNotFound = errors.New("though node not found")
)

Functions

This section is empty.

Types

type DBColumn

type DBColumn struct {
	ID         int32
	Name       string
	Type       string
	Array      bool
	NotNull    bool
	PrimaryKey bool
	UniqueKey  bool
	FullText   bool
	FKeySchema string
	FKeyTable  string
	FKeyCol    string
	Blocked    bool
	Table      string
	Schema     string
}

func DiscoverColumns added in v0.15.70

func DiscoverColumns(db *sql.DB, dbtype string, blockList []string) ([]DBColumn, error)

func (DBColumn) String

func (col DBColumn) String() string

type DBFuncParam

type DBFuncParam struct {
	ID   int
	Name sql.NullString
	Type string
}

type DBFunction

type DBFunction struct {
	Name   string
	Params []DBFuncParam
}

func DiscoverFunctions added in v0.15.70

func DiscoverFunctions(db *sql.DB, blockList []string) ([]DBFunction, error)

type DBInfo

type DBInfo struct {
	Type      string
	Version   int
	Schema    string
	Name      string
	Tables    []DBTable
	Functions []DBFunction
	VTables   []VirtualTable
	// contains filtered or unexported fields
}

func GetDBInfo

func GetDBInfo(
	db *sql.DB,
	dbType string,
	blockList []string) (*DBInfo, error)

func GetTestDBInfo

func GetTestDBInfo() *DBInfo

func NewDBInfo added in v0.15.70

func NewDBInfo(
	dbType string,
	dbVersion int,
	dbSchema string,
	dbName string,
	cols []DBColumn,
	funcs []DBFunction,
	blockList []string) *DBInfo

func (*DBInfo) AddTable

func (di *DBInfo) AddTable(t DBTable)

func (*DBInfo) GetColumn

func (di *DBInfo) GetColumn(schema, table, column string) (*DBColumn, error)

func (*DBInfo) GetTable added in v0.15.70

func (di *DBInfo) GetTable(schema, table string) (*DBTable, error)

type DBRel

type DBRel struct {
	Type  RelType
	Left  DBRelLeft
	Right DBRelRight
}

func PathToRel added in v0.15.70

func PathToRel(p TPath) DBRel

func (*DBRel) String

func (re *DBRel) String() string

type DBRelLeft added in v0.15.63

type DBRelLeft struct {
	Ti  DBTable
	Col DBColumn
}

type DBRelRight added in v0.15.63

type DBRelRight struct {
	VTable string
	Ti     DBTable
	Col    DBColumn
}

type DBSchema

type DBSchema struct {
	SingularSuffix SingularInfo // singular suffix
	// contains filtered or unexported fields
}

func GetTestSchema

func GetTestSchema() (*DBSchema, error)

func NewDBSchema

func NewDBSchema(
	info *DBInfo,
	aliases map[string][]string) (*DBSchema, error)

func (*DBSchema) DBName added in v0.15.84

func (s *DBSchema) DBName() string

func (*DBSchema) DBSchema added in v0.15.84

func (s *DBSchema) DBSchema() string

func (*DBSchema) DBType added in v0.15.84

func (s *DBSchema) DBType() string

func (*DBSchema) DBVersion

func (s *DBSchema) DBVersion() int

func (*DBSchema) Find added in v0.15.70

func (s *DBSchema) Find(schema, name string) (DBTable, error)

func (*DBSchema) FindPath added in v0.15.70

func (s *DBSchema) FindPath(from, to, through string) ([]TPath, error)

func (*DBSchema) GetAliases added in v0.15.50

func (s *DBSchema) GetAliases() map[string]DBTable

func (*DBSchema) GetFirstDegree added in v0.16.27

func (s *DBSchema) GetFirstDegree(schema, table string) (map[string]DBTable, error)

func (*DBSchema) GetFunctions

func (s *DBSchema) GetFunctions() map[string]DBFunction

func (*DBSchema) GetSecondDegree added in v0.16.27

func (s *DBSchema) GetSecondDegree(schema, table string) (map[string]DBTable, error)

func (*DBSchema) GetTables added in v0.15.80

func (s *DBSchema) GetTables() []DBTable

func (*DBSchema) IsAlias added in v0.16.9

func (s *DBSchema) IsAlias(name string) bool

type DBTable

type DBTable struct {
	Schema       string
	Name         string
	Type         string
	Columns      []DBColumn
	PrimaryCol   DBColumn
	SecondaryCol DBColumn
	FullText     []DBColumn
	Blocked      bool
	// contains filtered or unexported fields
}

func NewDBTable added in v0.15.70

func NewDBTable(schema, name, _type string, cols []DBColumn) DBTable

func (*DBTable) GetColumn added in v0.15.70

func (ti *DBTable) GetColumn(name string) (DBColumn, error)

func (*DBTable) String added in v0.15.70

func (ti *DBTable) String() string

type RelType

type RelType int
const (
	RelNone RelType = iota
	RelOneToOne
	RelOneToMany
	RelPolymorphic
	RelRecursive
	RelEmbedded
	RelRemote
	RelSkip
)

func (RelType) String

func (i RelType) String() string

type SingularInfo added in v0.16.26

type SingularInfo struct {
	Value string // Suffix value defined by the user
	Lower string // Lower-cased suffix used for treatment inside our code
}

type TEdge added in v0.15.70

type TEdge struct {
	From, To, Weight int32

	Type   RelType
	LT, RT DBTable
	L, R   DBColumn
	// contains filtered or unexported fields
}

type TPath added in v0.15.70

type TPath struct {
	Rel RelType
	LT  DBTable
	LC  DBColumn
	RT  DBTable
	RC  DBColumn
}

type VirtualTable

type VirtualTable struct {
	Name       string
	IDColumn   string
	TypeColumn string
	FKeyColumn string
}

Jump to

Keyboard shortcuts

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