Documentation ¶
Index ¶
- Variables
- func GetRelName(colName string) string
- type DBColumn
- type DBFuncParam
- type DBFunction
- type DBInfo
- type DBRel
- type DBRelLeft
- type DBRelRight
- type DBSchema
- func (s *DBSchema) DBName() string
- func (s *DBSchema) DBSchema() string
- func (s *DBSchema) DBType() string
- func (s *DBSchema) DBVersion() int
- func (s *DBSchema) Find(schema, name string) (DBTable, error)
- func (s *DBSchema) FindPath(from, to, through string) ([]TPath, error)
- func (s *DBSchema) GetAliases() map[string]DBTable
- func (s *DBSchema) GetFirstDegree(t DBTable) (items []RelNode, err error)
- func (s *DBSchema) GetFunctions() map[string]DBFunction
- func (s *DBSchema) GetSecondDegree(t DBTable) (items []RelNode, err error)
- func (s *DBSchema) GetTables() []DBTable
- func (s *DBSchema) IsAlias(name string) bool
- func (s *DBSchema) PrintEdgeInfo(e edgeInfo)
- func (s *DBSchema) PrintLines(lines []util.Edge)
- type DBTable
- type RelNode
- type RelType
- type TEdge
- type TPath
- type VirtualTable
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type DBColumn ¶
type DBColumn struct { Comment string ID int32 Name string Type string Array bool NotNull bool PrimaryKey bool UniqueKey bool FullText bool FKRecursive bool FKeySchema string FKeyTable string FKeyCol string Blocked bool Table string Schema string }
DBColumn returns the column as a string
func DiscoverColumns ¶
DiscoverColumns returns the columns of a table
type DBFuncParam ¶
DBFuncParam holds the database function parameter information
type DBFunction ¶
type DBFunction struct { Comment string Schema string Name string Type string Agg bool Inputs []DBFuncParam Outputs []DBFuncParam }
DBFunction holds the database function information
func DiscoverFunctions ¶
DiscoverFunctions returns the functions of a database
func (*DBFunction) GetInput ¶
func (fn *DBFunction) GetInput(name string) (ret DBFuncParam, err error)
GetInput returns the input of a function
func (DBFunction) String ¶
func (fn DBFunction) String() string
String returns a string representation of the DBFunction
type DBInfo ¶
type DBInfo struct { Type string Version int Schema string Name string Tables []DBTable Functions []DBFunction VTables []VirtualTable `json:"-"` // contains filtered or unexported fields }
DBInfo holds the database schema information
func GetTestDBInfo ¶
func GetTestDBInfo() *DBInfo
func NewDBInfo ¶
func NewDBInfo( dbType string, dbVersion int, dbSchema string, dbName string, cols []DBColumn, funcs []DBFunction, blockList []string, ) *DBInfo
NewDBInfo returns a new DBInfo object
type DBRel ¶
type DBRel struct { Type RelType Left DBRelLeft Right DBRelRight }
DBRel represents a database relationship
type DBRelRight ¶
DBRelRight represents a database relationship
type DBSchema ¶
type DBSchema struct {
// contains filtered or unexported fields
}
func GetTestSchema ¶
func NewDBSchema ¶
NewDBSchema creates a new database schema
func (*DBSchema) GetAliases ¶
GetAliases returns a map of table aliases
func (*DBSchema) GetFirstDegree ¶
GetFirstDegree returns the first degree relationships of a table
func (*DBSchema) GetFunctions ¶
func (s *DBSchema) GetFunctions() map[string]DBFunction
GetFunction returns a function from the schema
func (*DBSchema) GetSecondDegree ¶
GetSecondDegree returns the second degree relationships of a table
func (*DBSchema) PrintEdgeInfo ¶
func (s *DBSchema) PrintEdgeInfo(e edgeInfo)
PrintEdgeInfo prints edge info
func (*DBSchema) PrintLines ¶
PrintLines prints the graph lines
type DBTable ¶
type DBTable struct { Comment string Schema string Name string Type string Columns []DBColumn PrimaryCol DBColumn SecondaryCol DBColumn FullText []DBColumn Blocked bool Func DBFunction // contains filtered or unexported fields }
DBTable holds the database table information
func NewDBTable ¶
NewDBTable returns a new DBTable object
func (*DBTable) ColumnExists ¶
ColumnExists returns true if a column exists in a table
type TEdge ¶
type TEdge struct {
From, To, Weight int32
Type RelType
LT, RT DBTable
L, R DBColumn
CName string
// contains filtered or unexported fields
}
TEdge represents a table edge for the graph